From 975636411b393622c8402c254609b42edab6120b Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Wed, 10 Jan 2018 18:23:53 +0200 Subject: [PATCH] fix: example value is not showed if it is false --- src/components/Fields/FieldDetail.tsx | 2 +- src/services/models/Field.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/components/Fields/FieldDetail.tsx b/src/components/Fields/FieldDetail.tsx index fd54d3bd37..655871ccbb 100644 --- a/src/components/Fields/FieldDetail.tsx +++ b/src/components/Fields/FieldDetail.tsx @@ -12,7 +12,7 @@ export class FieldDetail extends React.PureComponent { return (
{this.props.label} {' '} - {this.props.value} + {JSON.stringify(this.props.value)}
); } diff --git a/src/services/models/Field.ts b/src/services/models/Field.ts index fd0da09681..1fc900cff6 100644 --- a/src/services/models/Field.ts +++ b/src/services/models/Field.ts @@ -35,8 +35,7 @@ export class FieldModel { this.schema = new SchemaModel(parser, info.schema || {}, schemaPointer, options); this.description = info.description === undefined ? this.schema.description || '' : info.description; - const example = info.example || this.schema.example; - this.example = example && JSON.stringify(example); + this.example = info.example || this.schema.example; this.deprecated = info.deprecated === undefined ? !!this.schema.deprecated : info.deprecated; parser.exitRef(infoOrRef);