feat: fixing api doc type export error
Signed-off-by: marmionl <l.marmion+copilot@elsvier.com>
This commit is contained in:
+8
-12
@@ -25,30 +25,26 @@ const LazyOpenApiDefinition = React.lazy(() =>
|
||||
})),
|
||||
);
|
||||
|
||||
type HttpMethods =
|
||||
| 'get'
|
||||
| 'put'
|
||||
| 'post'
|
||||
| 'delete'
|
||||
| 'options'
|
||||
| 'head'
|
||||
| 'patch'
|
||||
| 'trace';
|
||||
|
||||
/** @public */
|
||||
export type OpenApiDefinitionWidgetProps = {
|
||||
definition: string;
|
||||
requestInterceptor?: (req: any) => any | Promise<any>;
|
||||
supportedSubmitMethods?: HttpMethods[];
|
||||
supportedSubmitMethods?: string[];
|
||||
};
|
||||
|
||||
/** @public */
|
||||
export const OpenApiDefinitionWidget = (
|
||||
props: OpenApiDefinitionWidgetProps,
|
||||
) => {
|
||||
const validSubmitMethods = props.supportedSubmitMethods?.map(method =>
|
||||
method.toLocaleLowerCase(),
|
||||
);
|
||||
return (
|
||||
<Suspense fallback={<Progress />}>
|
||||
<LazyOpenApiDefinition {...props} />
|
||||
<LazyOpenApiDefinition
|
||||
{...props}
|
||||
supportedSubmitMethods={validSubmitMethods}
|
||||
/>
|
||||
</Suspense>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user