(props: {
mediaTypeObject: OpenAPIV3.MediaTypeObject;
mediaType: string;
context: OpenAPIContext;
})
| 94 | * Get the examples from a media type object. |
| 95 | */ |
| 96 | export function getExamples(props: { |
| 97 | mediaTypeObject: OpenAPIV3.MediaTypeObject; |
| 98 | mediaType: string; |
| 99 | context: OpenAPIContext; |
| 100 | }) { |
| 101 | const { mediaTypeObject, mediaType, context } = props; |
| 102 | const examples = getExamplesFromMediaTypeObject({ mediaTypeObject, mediaType, context }); |
| 103 | const syntax = getSyntaxFromMediaType(mediaType); |
| 104 | |
| 105 | return examples.map((example) => { |
| 106 | return { |
| 107 | key: example.key, |
| 108 | label: example.example.summary || example.key, |
| 109 | body: ( |
| 110 | <OpenAPIExample example={example.example} context={props.context} syntax={syntax} /> |
| 111 | ), |
| 112 | }; |
| 113 | }); |
| 114 | } |
| 115 | |
| 116 | /** |
| 117 | * Get the syntax from a media type. |
no test coverage detected
searching dependent graphs…