Fix @gitbook/react-openapi when react import are mandatory (#2389)

This commit is contained in:
Samy Pessé
2024-07-21 19:43:50 +02:00
committed by GitHub
parent f6bacea1ae
commit bd0ca5babd
13 changed files with 19 additions and 11 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@gitbook/react-openapi': minor
---
Fix missing react imports
+2 -9
View File
@@ -1,12 +1,5 @@
# `@gitbook/react-openapi`
React components to render OpenAPI operations.
Style-less React components to render OpenAPI operation blocks.
## Features
- Generate code samples for the request
- Support custom cde samples with `x-codeSamples` (Redocly syntax)
## TODO
- Support for trying out the request
Note: The package is a TypeScript package and do not expose JS built files.
+1
View File
@@ -1,3 +1,4 @@
import * as React from 'react';
import classNames from 'classnames';
export function Markdown(props: { source: string; className?: string }) {
@@ -1,4 +1,4 @@
import { OpenAPIV3 } from 'openapi-types';
import * as React from 'react';
import { CodeSampleInput, codeSampleGenerators } from './code-samples';
import { OpenAPIOperationData, toJSON } from './fetchOpenAPIOperation';
@@ -1,3 +1,4 @@
import * as React from 'react';
import classNames from 'classnames';
import { OpenAPIOperationData, toJSON } from './fetchOpenAPIOperation';
@@ -1,3 +1,5 @@
import * as React from 'react';
import { OpenAPIV3 } from 'openapi-types';
import { OpenAPIRootSchema } from './OpenAPISchema';
import { noReference } from './utils';
@@ -1,3 +1,4 @@
import * as React from 'react';
import classNames from 'classnames';
import { OpenAPIV3 } from 'openapi-types';
import { OpenAPIRootSchema, OpenAPISchemaProperties } from './OpenAPISchema';
@@ -1,3 +1,4 @@
import * as React from 'react';
import { InteractiveSection } from './InteractiveSection';
import { OpenAPIOperationData } from './fetchOpenAPIOperation';
import { generateSchemaExample } from './generateSchemaExample';
@@ -1,3 +1,4 @@
import * as React from 'react';
import classNames from 'classnames';
import { OpenAPIV3 } from 'openapi-types';
import { noReference } from './utils';
@@ -1,3 +1,4 @@
import * as React from 'react';
import { OpenAPIV3 } from 'openapi-types';
import { OpenAPIClientContext } from './types';
import { InteractiveSection } from './InteractiveSection';
@@ -1,3 +1,4 @@
import * as React from 'react';
import { OpenAPIV3 } from 'openapi-types';
import { OpenAPIServerURLVariable } from './OpenAPIServerURLVariable';
@@ -1,8 +1,8 @@
'use client';
import * as React from 'react';
import classNames from 'classnames';
import { OpenAPIV3 } from 'openapi-types';
import React from 'react';
/**
* Interactive component to show the value of a server variable and let the user change it.
@@ -1,5 +1,6 @@
'use client';
import * as React from 'react';
import { OpenAPIV3 } from 'openapi-types';
import { OpenAPIOperationData, fromJSON } from './fetchOpenAPIOperation';