We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@jellydn Because of newest swagger-ui-react, this example must be updated.
swagger-ui-react
Otherwise current example produces this error.
This code works with the newest swagger-ui-react:
import { GetStaticProps, InferGetStaticPropsType } from 'next'; import dynamic from "next/dynamic"; import { createSwaggerSpec } from 'next-swagger-doc'; import 'swagger-ui-react/swagger-ui.css'; const SwaggerUI = dynamic(import('swagger-ui-react'), { ssr: false }); const ApiDoc = ({ spec }: InferGetStaticPropsType<typeof getStaticProps>) => { return ( <SwaggerUI spec={spec} /> ); }; export const getStaticProps: GetStaticProps = async ctx => { const spec: Record<string, any> = createSwaggerSpec({ definition: { openapi: '3.0.0', info: { title: 'NextJS Swagger', version: '0.1.0', }, }, }); return { props: { spec, }, }; }; export default ApiDoc;
The text was updated successfully, but these errors were encountered:
Thanks @mbrain-io Closed by 931514e
Sorry, something went wrong.
No branches or pull requests
@jellydn Because of newest
swagger-ui-react
, this example must be updated.Otherwise current example produces this error.
This code works with the newest
swagger-ui-react
:The text was updated successfully, but these errors were encountered: