We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bcf8778 commit 70be2c6Copy full SHA for 70be2c6
.changeset/polite-nails-listen.md
@@ -0,0 +1,5 @@
1
+---
2
+'@gitbook/react-openapi': patch
3
4
+
5
+Stringify default value
packages/react-openapi/src/OpenAPISchemaName.tsx
@@ -1,5 +1,6 @@
import type { OpenAPIV3 } from '@gitbook/openapi-parser';
import type React from 'react';
+import { stringifyOpenAPI } from './stringifyOpenAPI';
interface OpenAPISchemaNameProps {
6
schema?: OpenAPIV3.SchemaObject;
@@ -50,7 +51,7 @@ function getAdditionalItems(schema: OpenAPIV3.SchemaObject): string {
50
51
52
// If the schema has a default value, we display it
53
if (typeof schema.default !== 'undefined') {
- additionalItems += ` · default: ${schema.default}`;
54
+ additionalItems += ` · default: ${stringifyOpenAPI(schema.default)}`;
55
}
56
57
if (schema.nullable) {
0 commit comments