fix: displaying json example when showObjectSchemaExamples enabled

This commit is contained in:
Alex Varchuk 2024-12-30 16:56:12 +01:00
parent 639fd2c32c
commit a373e608d3
No known key found for this signature in database
GPG Key ID: 8A9260AE529FF454

View File

@ -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);
}
}