We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e721f17 commit fe8acc9Copy full SHA for fe8acc9
.changeset/smart-mayflies-cry.md
@@ -0,0 +1,5 @@
1
+---
2
+'@gitbook/react-openapi': minor
3
4
+
5
+Fix an issue where a missing OpenAPI example would crash the page.
packages/react-openapi/src/OpenAPISchema.tsx
@@ -53,7 +53,9 @@ export function OpenAPISchemaProperty(
53
typeof schema.example === 'number' ||
54
typeof schema.example === 'boolean' ||
55
(Array.isArray(schema.example) && schema.example.length > 0) ||
56
- (typeof schema.example === 'object' && Object.keys(schema.example).length > 0)
+ (typeof schema.example === 'object' &&
57
+ schema.example !== null &&
58
+ Object.keys(schema.example).length > 0)
59
);
60
};
61
return (
0 commit comments