mirror of
https://github.com/Redocly/redoc.git
synced 2025-01-31 10:04:08 +03:00
fix: hide empty example when it is not defined
This commit is contained in:
parent
027d83a88f
commit
4bd499f0e9
|
@ -33,7 +33,8 @@ export class FieldDetails extends React.PureComponent<FieldProps> {
|
||||||
if (showExamples) {
|
if (showExamples) {
|
||||||
const label = l('example') + ':';
|
const label = l('example') + ':';
|
||||||
if (field.in && field.style) {
|
if (field.in && field.style) {
|
||||||
const serializedValue = serializeParameterValue(field, example);
|
const serializedValue =
|
||||||
|
example !== undefined ? serializeParameterValue(field, example) : undefined;
|
||||||
exampleField = <FieldDetail label={label} value={serializedValue} raw={true} />;
|
exampleField = <FieldDetail label={label} value={serializedValue} raw={true} />;
|
||||||
} else {
|
} else {
|
||||||
exampleField = <FieldDetail label={label} value={example} />;
|
exampleField = <FieldDetail label={label} value={example} />;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user