mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-12 05:48:57 +00:00
Fix an issue where a missing OpenAPI example would crash the page. (#2806)
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@gitbook/react-openapi': minor
|
||||
---
|
||||
|
||||
Fix an issue where a missing OpenAPI example would crash the page.
|
||||
@@ -53,7 +53,9 @@ export function OpenAPISchemaProperty(
|
||||
typeof schema.example === 'number' ||
|
||||
typeof schema.example === 'boolean' ||
|
||||
(Array.isArray(schema.example) && schema.example.length > 0) ||
|
||||
(typeof schema.example === 'object' && Object.keys(schema.example).length > 0)
|
||||
(typeof schema.example === 'object' &&
|
||||
schema.example !== null &&
|
||||
Object.keys(schema.example).length > 0)
|
||||
);
|
||||
};
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user