fix: hide empty example when it is not defined

This commit is contained in:
Roman Hotsiy 2019-07-07 19:43:31 +03:00
parent 027d83a88f
commit 4bd499f0e9
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0

View File

@ -33,7 +33,8 @@ export class FieldDetails extends React.PureComponent<FieldProps> {
if (showExamples) {
const label = l('example') + ':';
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} />;
} else {
exampleField = <FieldDetail label={label} value={example} />;