File size: 486 Bytes
bb11990
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
'use client';
import 'swagger-ui-react/swagger-ui.css';
import dynamic from "next/dynamic";

type Props = {
  spec: Record<string, any>,
};

const SwaggerUI = dynamic(() => import('swagger-ui-react'), { ssr: false });

function Swagger({ spec }: Props) {
  return <SwaggerUI spec={spec} requestInterceptor={(req) => {

    // Remove cookies before sending requests

    req.credentials = 'omit';

    console.log(req);

    return req;

  }} />;
}

export default Swagger;