Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/polite-nails-listen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@gitbook/react-openapi': patch
---

Stringify default value
3 changes: 2 additions & 1 deletion packages/react-openapi/src/OpenAPISchemaName.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { OpenAPIV3 } from '@gitbook/openapi-parser';
import type React from 'react';
import { stringifyOpenAPI } from './stringifyOpenAPI';

interface OpenAPISchemaNameProps {
schema?: OpenAPIV3.SchemaObject;
Expand Down Expand Up @@ -50,7 +51,7 @@ function getAdditionalItems(schema: OpenAPIV3.SchemaObject): string {

// If the schema has a default value, we display it
if (typeof schema.default !== 'undefined') {
additionalItems += ` · default: ${schema.default}`;
additionalItems += ` · default: ${stringifyOpenAPI(schema.default)}`;
}

if (schema.nullable) {
Expand Down