mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-21 01:53:26 +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 === 'number' ||
|
||||||
typeof schema.example === 'boolean' ||
|
typeof schema.example === 'boolean' ||
|
||||||
(Array.isArray(schema.example) && schema.example.length > 0) ||
|
(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 (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user