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 authored Jan 8, 2025
1 parent d614d2d commit 59ee73f
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 59ee73f

Please sign in to comment.