@gitbook/react-openapi 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/InteractiveSection.d.ts +33 -0
  3. package/dist/InteractiveSection.js +32 -0
  4. package/dist/Markdown.d.ts +5 -0
  5. package/dist/Markdown.js +6 -0
  6. package/dist/OpenAPICodeSample.d.ts +11 -0
  7. package/dist/OpenAPICodeSample.js +76 -0
  8. package/dist/OpenAPIOperation.d.ts +11 -0
  9. package/dist/OpenAPIOperation.js +38 -0
  10. package/dist/OpenAPIRequestBody.d.ts +10 -0
  11. package/dist/OpenAPIRequestBody.js +18 -0
  12. package/dist/OpenAPIResponse.d.ts +10 -0
  13. package/dist/OpenAPIResponse.js +32 -0
  14. package/dist/OpenAPIResponseExample.d.ts +10 -0
  15. package/dist/OpenAPIResponseExample.js +48 -0
  16. package/dist/OpenAPIResponses.d.ts +10 -0
  17. package/dist/OpenAPIResponses.js +18 -0
  18. package/dist/OpenAPISchema.d.ts +45 -0
  19. package/dist/OpenAPISchema.js +232 -0
  20. package/dist/OpenAPISchema.test.d.ts +1 -0
  21. package/dist/OpenAPISchema.test.js +91 -0
  22. package/dist/OpenAPISecurities.d.ts +10 -0
  23. package/dist/OpenAPISecurities.js +42 -0
  24. package/dist/OpenAPIServerURL.d.ts +12 -0
  25. package/dist/OpenAPIServerURL.js +51 -0
  26. package/dist/OpenAPIServerURLVariable.d.ts +9 -0
  27. package/dist/OpenAPIServerURLVariable.js +10 -0
  28. package/dist/OpenAPISpec.d.ts +12 -0
  29. package/dist/OpenAPISpec.js +70 -0
  30. package/dist/ScalarApiButton.d.ts +5 -0
  31. package/dist/ScalarApiButton.js +14 -0
  32. package/dist/code-samples.d.ts +14 -0
  33. package/dist/code-samples.js +50 -0
  34. package/dist/fetchOpenAPIOperation.d.ts +72 -0
  35. package/dist/fetchOpenAPIOperation.js +124 -0
  36. package/dist/fetchOpenAPIOperation.test.d.ts +1 -0
  37. package/dist/fetchOpenAPIOperation.test.js +152 -0
  38. package/dist/generateSchemaExample.d.ts +17 -0
  39. package/dist/generateSchemaExample.js +119 -0
  40. package/dist/index.d.ts +3 -0
  41. package/dist/index.js +2 -0
  42. package/dist/resolveOpenAPIPath.d.ts +7 -0
  43. package/dist/resolveOpenAPIPath.js +112 -0
  44. package/dist/resolveOpenAPIPath.test.d.ts +1 -0
  45. package/dist/resolveOpenAPIPath.test.js +39 -0
  46. package/dist/tsconfig.tsbuildinfo +1 -0
  47. package/dist/types.d.ts +32 -0
  48. package/dist/types.js +1 -0
  49. package/dist/utils.d.ts +2 -0
  50. package/dist/utils.js +6 -0
  51. package/package.json +9 -4
  52. package/src/InteractiveSection.tsx +14 -12
  53. package/src/OpenAPICodeSample.tsx +8 -9
  54. package/src/OpenAPIOperation.tsx +7 -3
  55. package/src/ScalarApiButton.tsx +5 -138
  56. package/src/fetchOpenAPIOperation.ts +1 -1
  57. package/src/types.ts +3 -0
  58. package/.turbo/turbo-build.log +0 -1
  59. package/tsconfig.json +0 -24
  60. package/tsconfig.tsbuildinfo +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @gitbook/react-openapi
2
2
 
3
+ ## 0.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 709f1a1: Update Scalar to the latest version, with faster performances and an improved experience
8
+
9
+ ### Patch Changes
10
+
11
+ - ede2335: Fix x-codeSamples: false not working at the single operation level
12
+ - 0426312: Fix tabs being empty for code samples when they are updated dynamically
13
+
14
+ ## 0.5.0
15
+
16
+ ### Minor Changes
17
+
18
+ - 3445db4: Fix files published in the NPM packages by defining "files" in "package.json"
19
+
3
20
  ## 0.4.0
4
21
 
5
22
  ### Minor Changes
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ interface InteractiveSectionTab {
3
+ key: string;
4
+ label: string;
5
+ body: React.ReactNode;
6
+ }
7
+ /**
8
+ * To optimize rendering, most of the components are server-components,
9
+ * and the interactiveness is mainly handled by a few key components like this one.
10
+ */
11
+ export declare function InteractiveSection(props: {
12
+ id?: string;
13
+ /** Class name to be set on the section, sub-elements will use it as prefix */
14
+ className: string;
15
+ /** If true, the content can be toggeable */
16
+ toggeable?: boolean;
17
+ /** Default state of the toggle */
18
+ defaultOpened?: boolean;
19
+ /** Icons to display for the toggle */
20
+ toggleOpenIcon?: React.ReactNode;
21
+ toggleCloseIcon?: React.ReactNode;
22
+ /** Tabs of content to display */
23
+ tabs?: Array<InteractiveSectionTab>;
24
+ /** Default tab to have opened */
25
+ defaultTab?: string;
26
+ /** Content of the header */
27
+ header: React.ReactNode;
28
+ /** Body of the section */
29
+ children?: React.ReactNode;
30
+ /** Children to display within the container */
31
+ overlay?: React.ReactNode;
32
+ }): React.JSX.Element;
33
+ export {};
@@ -0,0 +1,32 @@
1
+ 'use client';
2
+ import classNames from 'classnames';
3
+ import React from 'react';
4
+ /**
5
+ * To optimize rendering, most of the components are server-components,
6
+ * and the interactiveness is mainly handled by a few key components like this one.
7
+ */
8
+ export function InteractiveSection(props) {
9
+ const { id, className, toggeable = false, defaultOpened = true, tabs = [], defaultTab = tabs[0]?.key, header, children, overlay, toggleOpenIcon = '▶', toggleCloseIcon = '▼', } = props;
10
+ const [opened, setOpened] = React.useState(defaultOpened);
11
+ const [selectedTabKey, setSelectedTab] = React.useState(defaultTab);
12
+ const selectedTab = tabs.find((tab) => tab.key === selectedTabKey) ?? tabs[0];
13
+ return (React.createElement("div", { id: id, className: classNames('openapi-section', toggeable ? 'openapi-section-toggeable' : null, className, toggeable ? `${className}-${opened ? 'opened' : 'closed'}` : null) },
14
+ React.createElement("div", { onClick: () => {
15
+ if (toggeable) {
16
+ setOpened(!opened);
17
+ }
18
+ }, className: classNames('openapi-section-header', `${className}-header`) },
19
+ React.createElement("div", { className: classNames('openapi-section-header-content', `${className}-header-content`) }, header),
20
+ React.createElement("div", { className: classNames('openapi-section-header-controls', `${className}-header-controls`), onClick: (event) => {
21
+ event.stopPropagation();
22
+ } },
23
+ tabs.length ? (React.createElement("select", { className: classNames('openapi-section-select', 'openapi-select', `${className}-tabs-select`), value: selectedTab.key, onChange: (event) => {
24
+ setSelectedTab(event.target.value);
25
+ setOpened(true);
26
+ } }, tabs.map((tab) => (React.createElement("option", { key: tab.key, value: tab.key }, tab.label))))) : null,
27
+ (children || selectedTab?.body) && toggeable ? (React.createElement("button", { className: classNames('openapi-section-toggle', `${className}-toggle`), onClick: () => setOpened(!opened) }, opened ? toggleCloseIcon : toggleOpenIcon)) : null)),
28
+ (!toggeable || opened) && (children || selectedTab?.body) ? (React.createElement("div", { className: classNames('openapi-section-body', `${className}-body`) },
29
+ children,
30
+ selectedTab?.body)) : null,
31
+ overlay));
32
+ }
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export declare function Markdown(props: {
3
+ source: string;
4
+ className?: string;
5
+ }): React.JSX.Element;
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ import classNames from 'classnames';
3
+ export function Markdown(props) {
4
+ const { source, className } = props;
5
+ return (React.createElement("div", { className: classNames('openapi-markdown', className), dangerouslySetInnerHTML: { __html: source } }));
6
+ }
@@ -0,0 +1,11 @@
1
+ import * as React from 'react';
2
+ import { OpenAPIOperationData } from './fetchOpenAPIOperation';
3
+ import { OpenAPIContextProps } from './types';
4
+ /**
5
+ * Display code samples to execute the operation.
6
+ * It supports the Redocly custom syntax as well (https://redocly.com/docs/api-reference-docs/specification-extensions/x-code-samples/)
7
+ */
8
+ export declare function OpenAPICodeSample(props: {
9
+ data: OpenAPIOperationData;
10
+ context: OpenAPIContextProps;
11
+ }): React.JSX.Element | null;
@@ -0,0 +1,76 @@
1
+ import * as React from 'react';
2
+ import { codeSampleGenerators } from './code-samples';
3
+ import { generateMediaTypeExample } from './generateSchemaExample';
4
+ import { InteractiveSection } from './InteractiveSection';
5
+ import { getServersURL } from './OpenAPIServerURL';
6
+ import { ScalarApiButton } from './ScalarApiButton';
7
+ import { noReference } from './utils';
8
+ /**
9
+ * Display code samples to execute the operation.
10
+ * It supports the Redocly custom syntax as well (https://redocly.com/docs/api-reference-docs/specification-extensions/x-code-samples/)
11
+ */
12
+ export function OpenAPICodeSample(props) {
13
+ const { data, context } = props;
14
+ const requestBody = noReference(data.operation.requestBody);
15
+ const requestBodyContent = requestBody ? Object.entries(requestBody.content)[0] : undefined;
16
+ const input = {
17
+ url: getServersURL(data.servers) + data.path,
18
+ method: data.method,
19
+ body: requestBodyContent
20
+ ? generateMediaTypeExample(requestBodyContent[1], { onlyRequired: true })
21
+ : undefined,
22
+ headers: {
23
+ ...getSecurityHeaders(data.securities),
24
+ ...(requestBodyContent
25
+ ? {
26
+ 'Content-Type': requestBodyContent[0],
27
+ }
28
+ : undefined),
29
+ },
30
+ };
31
+ const autoCodeSamples = codeSampleGenerators.map((generator) => ({
32
+ key: `default-${generator.id}`,
33
+ label: generator.label,
34
+ body: React.createElement(context.CodeBlock, { code: generator.generate(input), syntax: generator.syntax }),
35
+ }));
36
+ // Use custom samples if defined
37
+ let customCodeSamples = null;
38
+ ['x-custom-examples', 'x-code-samples', 'x-codeSamples'].forEach((key) => {
39
+ const customSamples = data.operation[key];
40
+ if (customSamples && Array.isArray(customSamples)) {
41
+ customCodeSamples = customSamples.map((sample) => ({
42
+ key: `redocly-${sample.lang}`,
43
+ label: sample.label,
44
+ body: React.createElement(context.CodeBlock, { code: sample.source, syntax: sample.lang }),
45
+ }));
46
+ }
47
+ });
48
+ // Code samples can be disabled at the top-level or at the operation level
49
+ // If code samples are defined at the operation level, it will override the top-level setting
50
+ const codeSamplesDisabled = data['x-codeSamples'] === false || data.operation['x-codeSamples'] === false;
51
+ const samples = customCodeSamples ?? (!codeSamplesDisabled ? autoCodeSamples : []);
52
+ if (samples.length === 0) {
53
+ return null;
54
+ }
55
+ return (React.createElement(InteractiveSection, { header: "Request", className: "openapi-codesample", tabs: samples, overlay: data['x-hideTryItPanel'] || data.operation['x-hideTryItPanel'] ? null : (React.createElement(ScalarApiButton, null)) }));
56
+ }
57
+ function getSecurityHeaders(securities) {
58
+ const security = securities[0];
59
+ if (!security) {
60
+ return {};
61
+ }
62
+ switch (security[1].type) {
63
+ case 'http': {
64
+ let scheme = security[1].scheme;
65
+ if (scheme === 'bearer') {
66
+ scheme = 'Bearer';
67
+ }
68
+ return {
69
+ Authorization: scheme + ' ' + (security[1].bearerFormat ?? '<token>'),
70
+ };
71
+ }
72
+ default: {
73
+ return {};
74
+ }
75
+ }
76
+ }
@@ -0,0 +1,11 @@
1
+ import * as React from 'react';
2
+ import { OpenAPIOperationData } from './fetchOpenAPIOperation';
3
+ import { OpenAPIContextProps } from './types';
4
+ /**
5
+ * Display an interactive OpenAPI operation.
6
+ */
7
+ export declare function OpenAPIOperation(props: {
8
+ className?: string;
9
+ data: OpenAPIOperationData;
10
+ context: OpenAPIContextProps;
11
+ }): React.JSX.Element;
@@ -0,0 +1,38 @@
1
+ import * as React from 'react';
2
+ import classNames from 'classnames';
3
+ import { toJSON } from './fetchOpenAPIOperation';
4
+ import { Markdown } from './Markdown';
5
+ import { OpenAPICodeSample } from './OpenAPICodeSample';
6
+ import { OpenAPIResponseExample } from './OpenAPIResponseExample';
7
+ import { OpenAPIServerURL } from './OpenAPIServerURL';
8
+ import { OpenAPISpec } from './OpenAPISpec';
9
+ import { ApiClientModalProvider } from '@scalar/api-client-react';
10
+ /**
11
+ * Display an interactive OpenAPI operation.
12
+ */
13
+ export function OpenAPIOperation(props) {
14
+ const { className, data, context } = props;
15
+ const { operation, servers, method, path } = data;
16
+ const clientContext = {
17
+ defaultInteractiveOpened: context.defaultInteractiveOpened,
18
+ specUrl: context.specUrl,
19
+ icons: context.icons,
20
+ };
21
+ return (React.createElement(ApiClientModalProvider, { configuration: { spec: { url: context.specUrl } }, initialRequest: { path: data.path, method: data.method } },
22
+ React.createElement("div", { className: classNames('openapi-operation', className) },
23
+ React.createElement("div", { className: "openapi-intro" },
24
+ React.createElement("h2", { className: "openapi-summary" }, operation.summary),
25
+ operation.description ? (React.createElement(Markdown, { className: "openapi-description", source: operation.description })) : null,
26
+ React.createElement("div", { className: "openapi-target" },
27
+ React.createElement("span", { className: classNames('openapi-method', `openapi-method-${method.toLowerCase()}`) }, method.toUpperCase()),
28
+ React.createElement("span", { className: "openapi-url" },
29
+ React.createElement(OpenAPIServerURL, { servers: servers }),
30
+ path))),
31
+ React.createElement("div", { className: classNames('openapi-columns') },
32
+ React.createElement("div", { className: classNames('openapi-column-spec') },
33
+ React.createElement(OpenAPISpec, { rawData: toJSON(data), context: clientContext })),
34
+ React.createElement("div", { className: classNames('openapi-column-preview') },
35
+ React.createElement("div", { className: classNames('openapi-column-preview-body') },
36
+ React.createElement(OpenAPICodeSample, { ...props }),
37
+ React.createElement(OpenAPIResponseExample, { ...props })))))));
38
+ }
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import { OpenAPIV3 } from 'openapi-types';
3
+ import { OpenAPIClientContext } from './types';
4
+ /**
5
+ * Display an interactive request body.
6
+ */
7
+ export declare function OpenAPIRequestBody(props: {
8
+ requestBody: OpenAPIV3.RequestBodyObject;
9
+ context: OpenAPIClientContext;
10
+ }): React.JSX.Element;
@@ -0,0 +1,18 @@
1
+ import * as React from 'react';
2
+ import { OpenAPIRootSchema } from './OpenAPISchema';
3
+ import { noReference } from './utils';
4
+ import { InteractiveSection } from './InteractiveSection';
5
+ import { Markdown } from './Markdown';
6
+ /**
7
+ * Display an interactive request body.
8
+ */
9
+ export function OpenAPIRequestBody(props) {
10
+ const { requestBody, context } = props;
11
+ return (React.createElement(InteractiveSection, { header: "Body", className: "openapi-requestbody", tabs: Object.entries(requestBody.content ?? {}).map(([contentType, mediaTypeObject]) => {
12
+ return {
13
+ key: contentType,
14
+ label: contentType,
15
+ body: (React.createElement(OpenAPIRootSchema, { schema: noReference(mediaTypeObject.schema) ?? {}, context: context })),
16
+ };
17
+ }), defaultOpened: context.defaultInteractiveOpened }, requestBody.description ? (React.createElement(Markdown, { source: requestBody.description, className: "openapi-requestbody-description" })) : null));
18
+ }
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import { OpenAPIV3 } from 'openapi-types';
3
+ import { OpenAPIClientContext } from './types';
4
+ /**
5
+ * Display an interactive response body.
6
+ */
7
+ export declare function OpenAPIResponse(props: {
8
+ response: OpenAPIV3.ResponseObject;
9
+ context: OpenAPIClientContext;
10
+ }): React.JSX.Element | null;
@@ -0,0 +1,32 @@
1
+ import * as React from 'react';
2
+ import classNames from 'classnames';
3
+ import { OpenAPIRootSchema, OpenAPISchemaProperties } from './OpenAPISchema';
4
+ import { noReference } from './utils';
5
+ import { InteractiveSection } from './InteractiveSection';
6
+ import { Markdown } from './Markdown';
7
+ /**
8
+ * Display an interactive response body.
9
+ */
10
+ export function OpenAPIResponse(props) {
11
+ const { response, context } = props;
12
+ const content = Object.entries(response.content ?? {});
13
+ const headers = Object.entries(response.headers ?? {}).map(([name, header]) => [name, noReference(header) ?? {}]);
14
+ if (content.length === 0 && !response.description && headers.length === 0) {
15
+ return null;
16
+ }
17
+ return (React.createElement(React.Fragment, null,
18
+ response.description ? (React.createElement(Markdown, { source: response.description, className: "openapi-response-description" })) : null,
19
+ headers.length > 0 ? (React.createElement(InteractiveSection, { toggeable: true, defaultOpened: !!context.defaultInteractiveOpened, toggleCloseIcon: context.icons.chevronDown, toggleOpenIcon: context.icons.chevronRight, header: "Headers", className: classNames('openapi-responseheaders') },
20
+ React.createElement(OpenAPISchemaProperties, { properties: headers.map(([name, header]) => ({
21
+ propertyName: name,
22
+ schema: noReference(header.schema) ?? {},
23
+ required: header.required,
24
+ })), context: context }))) : null,
25
+ content.length > 0 ? (React.createElement(InteractiveSection, { header: "Body", className: classNames('openapi-responsebody'), tabs: content.map(([contentType, mediaType]) => {
26
+ return {
27
+ key: contentType,
28
+ label: contentType,
29
+ body: (React.createElement(OpenAPIRootSchema, { schema: noReference(mediaType.schema) ?? {}, context: context })),
30
+ };
31
+ }) })) : null));
32
+ }
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import { OpenAPIOperationData } from './fetchOpenAPIOperation';
3
+ import { OpenAPIContextProps } from './types';
4
+ /**
5
+ * Display an example of the response content.
6
+ */
7
+ export declare function OpenAPIResponseExample(props: {
8
+ data: OpenAPIOperationData;
9
+ context: OpenAPIContextProps;
10
+ }): React.JSX.Element | null;
@@ -0,0 +1,48 @@
1
+ import * as React from 'react';
2
+ import { InteractiveSection } from './InteractiveSection';
3
+ import { generateSchemaExample } from './generateSchemaExample';
4
+ import { noReference } from './utils';
5
+ /**
6
+ * Display an example of the response content.
7
+ */
8
+ export function OpenAPIResponseExample(props) {
9
+ const { data, context } = props;
10
+ // if there are no responses defined for the operation
11
+ if (!data.operation.responses) {
12
+ return null;
13
+ }
14
+ const responses = Object.entries(data.operation.responses);
15
+ // Sort response to get 200, and 2xx first
16
+ responses.sort(([a], [b]) => {
17
+ if (a === 'default') {
18
+ return 1;
19
+ }
20
+ if (b === 'default') {
21
+ return -1;
22
+ }
23
+ if (a === '200') {
24
+ return -1;
25
+ }
26
+ if (b === '200') {
27
+ return 1;
28
+ }
29
+ return Number(a) - Number(b);
30
+ });
31
+ // Take the first one
32
+ const response = responses[0];
33
+ if (!response) {
34
+ return null;
35
+ }
36
+ const responseObject = noReference(response[1]);
37
+ const schema = noReference((responseObject.content?.['application/json'] ??
38
+ responseObject.content?.[Object.keys(responseObject.content)[0]])?.schema);
39
+ if (!schema) {
40
+ return null;
41
+ }
42
+ const example = generateSchemaExample(schema);
43
+ if (example === undefined) {
44
+ return null;
45
+ }
46
+ return (React.createElement(InteractiveSection, { header: "Response", className: "openapi-response-example" },
47
+ React.createElement(context.CodeBlock, { code: typeof example === 'string' ? example : JSON.stringify(example, null, 2), syntax: "json" })));
48
+ }
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import { OpenAPIV3 } from 'openapi-types';
3
+ import { OpenAPIClientContext } from './types';
4
+ /**
5
+ * Display an interactive response body.
6
+ */
7
+ export declare function OpenAPIResponses(props: {
8
+ responses: OpenAPIV3.ResponsesObject;
9
+ context: OpenAPIClientContext;
10
+ }): React.JSX.Element;
@@ -0,0 +1,18 @@
1
+ import * as React from 'react';
2
+ import classNames from 'classnames';
3
+ import { noReference } from './utils';
4
+ import { OpenAPIResponse } from './OpenAPIResponse';
5
+ import { InteractiveSection } from './InteractiveSection';
6
+ /**
7
+ * Display an interactive response body.
8
+ */
9
+ export function OpenAPIResponses(props) {
10
+ const { responses, context } = props;
11
+ return (React.createElement(InteractiveSection, { header: "Response", className: classNames('openapi-responses'), tabs: Object.entries(responses).map(([statusCode, response]) => {
12
+ return {
13
+ key: statusCode,
14
+ label: statusCode,
15
+ body: React.createElement(OpenAPIResponse, { response: noReference(response), context: context }),
16
+ };
17
+ }) }));
18
+ }
@@ -0,0 +1,45 @@
1
+ import { OpenAPIV3 } from 'openapi-types';
2
+ import React from 'react';
3
+ import { OpenAPIClientContext } from './types';
4
+ type CircularRefsIds = Map<OpenAPIV3.SchemaObject, string>;
5
+ interface OpenAPISchemaPropertyEntry {
6
+ propertyName?: string;
7
+ required?: boolean;
8
+ schema: OpenAPIV3.SchemaObject;
9
+ }
10
+ /**
11
+ * Render a property of an OpenAPI schema.
12
+ */
13
+ export declare function OpenAPISchemaProperty(props: OpenAPISchemaPropertyEntry & {
14
+ /** Set of objects already observed as parents */
15
+ circularRefs?: CircularRefsIds;
16
+ context: OpenAPIClientContext;
17
+ className?: string;
18
+ }): React.JSX.Element;
19
+ /**
20
+ * Render a set of properties of an OpenAPI schema.
21
+ */
22
+ export declare function OpenAPISchemaProperties(props: {
23
+ id?: string;
24
+ properties: OpenAPISchemaPropertyEntry[];
25
+ circularRefs?: CircularRefsIds;
26
+ context: OpenAPIClientContext;
27
+ }): React.JSX.Element | null;
28
+ /**
29
+ * Render a root schema (such as the request body or response body).
30
+ */
31
+ export declare function OpenAPIRootSchema(props: {
32
+ schema: OpenAPIV3.SchemaObject;
33
+ context: OpenAPIClientContext;
34
+ }): React.JSX.Element;
35
+ /**
36
+ * Render the enum value for a schema.
37
+ */
38
+ export declare function OpenAPISchemaEnum(props: {
39
+ enumValues: any[];
40
+ }): React.JSX.Element;
41
+ /**
42
+ * Get the alternatives to display for a schema.
43
+ */
44
+ export declare function getSchemaAlternatives(schema: OpenAPIV3.SchemaObject, ancestors?: Set<OpenAPIV3.SchemaObject>): null | [OpenAPIV3.SchemaObject[], OpenAPIV3.DiscriminatorObject | undefined];
45
+ export {};