(props: {
example: OpenAPIV3.ExampleObject;
context: OpenAPIContext;
syntax: string;
})
| 10 | * Display an example. |
| 11 | */ |
| 12 | export function OpenAPIExample(props: { |
| 13 | example: OpenAPIV3.ExampleObject; |
| 14 | context: OpenAPIContext; |
| 15 | syntax: string; |
| 16 | }) { |
| 17 | const { example, context, syntax } = props; |
| 18 | const code = stringifyExample({ example, syntax }); |
| 19 | |
| 20 | if (code === null) { |
| 21 | return <OpenAPIEmptyExample context={context} />; |
| 22 | } |
| 23 | |
| 24 | return context.renderCodeBlock({ code, syntax }); |
| 25 | } |
| 26 | |
| 27 | function stringifyExample(args: { example: OpenAPIV3.ExampleObject; syntax: string }): |
| 28 | | string |
nothing calls this directly
no test coverage detected