MCPcopy Index your code
hub / github.com/GitbookIO/gitbook / OpenAPIExample

Function OpenAPIExample

packages/react-openapi/src/OpenAPIExample.tsx:12–25  ·  view source on GitHub ↗
(props: {
    example: OpenAPIV3.ExampleObject;
    context: OpenAPIContext;
    syntax: string;
})

Source from the content-addressed store, hash-verified

10 * Display an example.
11 */
12export 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
27function stringifyExample(args: { example: OpenAPIV3.ExampleObject; syntax: string }):
28 | string

Callers

nothing calls this directly

Calls 1

stringifyExampleFunction · 0.85

Tested by

no test coverage detected