Skip to content

Commit

Permalink
fix: displaying json example when showObjectSchemaExamples enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexVarchuk committed Dec 30, 2024
1 parent 639fd2c commit a373e60
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit a373e60

Please sign in to comment.