mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-26 10:33:44 +03:00
fix: example value is not showed if it is false
This commit is contained in:
parent
174345399f
commit
975636411b
|
@ -12,7 +12,7 @@ export class FieldDetail extends React.PureComponent<FieldDetailProps> {
|
|||
return (
|
||||
<div>
|
||||
<FieldLabel> {this.props.label} </FieldLabel>{' '}
|
||||
<ExampleValue> {this.props.value} </ExampleValue>
|
||||
<ExampleValue> {JSON.stringify(this.props.value)} </ExampleValue>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user