feat: adding supportedSubmitMethods prop to SwaggerUI component
Signed-off-by: marmionl <l.marmion@elsvier.com> Signed-off-by: marmionl <l.marmion+copilot@elsvier.com>
This commit is contained in:
@@ -97,11 +97,13 @@ paths:
|
||||
`;
|
||||
|
||||
const requestInterceptor = (req: any) => req;
|
||||
const supportedSubmitMethods = ['get', 'post', 'put', 'delete'];
|
||||
|
||||
const { findByRole, getByRole, getByLabelText } = await renderInTestApp(
|
||||
<OpenApiDefinition
|
||||
definition={definition}
|
||||
requestInterceptor={requestInterceptor}
|
||||
supportedSubmitMethods={supportedSubmitMethods}
|
||||
/>,
|
||||
);
|
||||
|
||||
|
||||
@@ -25,10 +25,21 @@ 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[];
|
||||
};
|
||||
|
||||
/** @public */
|
||||
|
||||
Reference in New Issue
Block a user