From a373e608d3f1df33b05adc818cb9659c5b82f7db Mon Sep 17 00:00:00 2001 From: Alex Varchuk Date: Mon, 30 Dec 2024 16:56:12 +0100 Subject: [PATCH] fix: displaying json example when showObjectSchemaExamples enabled --- src/utils/openapi.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/openapi.ts b/src/utils/openapi.ts index 33e0193a2..1d3a33c5f 100644 --- a/src/utils/openapi.ts +++ b/src/utils/openapi.ts @@ -393,7 +393,7 @@ export function getSerializedValue(field: FieldModel, example: any) { // decode for better readability in examples: see https://github.com/Redocly/redoc/issues/1138 return decodeURIComponent(serializeParameterValue(field, example)); } else { - return String(example); + return typeof example === 'object' ? example : String(example); } }