mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-22 18:43:29 +00:00
Fix crash when displaying invalid Swagger 2.0 block (#214)
* Ignore errors when converting Swagger 2 to OpenAPI 3 * Apply page-api-block only when a block is actually displayed * Format * Try to be more lax
This commit is contained in:
@@ -50,13 +50,18 @@ async function OpenAPIBody(props: BlockProps<DocumentBlockSwagger>) {
|
||||
CodeBlock: PlainCodeBlock,
|
||||
defaultInteractiveOpened: context.mode === 'print',
|
||||
}}
|
||||
className="openapi-block"
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
function OpenAPIFallback() {
|
||||
return (
|
||||
<div role="status" aria-busy className={tcls('flex', 'flex-1', 'flex-col', 'gap-3')}>
|
||||
<div
|
||||
role="status"
|
||||
aria-busy
|
||||
className={'openapi-block ' + tcls('flex', 'flex-1', 'flex-col', 'gap-3')}
|
||||
>
|
||||
<LoadingPane
|
||||
tile={12}
|
||||
style={['rounded-md', 'h-[47px]', '[max-width:calc(48rem-1px)]']}
|
||||
|
||||
Reference in New Issue
Block a user