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:
marmionl
2024-01-12 13:38:29 +00:00
parent f56b7290da
commit 170c023384
4 changed files with 71 additions and 0 deletions
@@ -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 */