fix: default false not displaying

fixes #544
This commit is contained in:
Roman Hotsiy 2018-06-25 09:10:43 +03:00
parent 83fca7d9ff
commit 4e5282e206
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0

View File

@ -142,7 +142,7 @@ export class SchemaModel {
this.displayType = this.items.displayType;
this.displayFormat = this.items.format;
this.typePrefix = this.items.typePrefix + 'Array of ';
this.title = this.title || this.items.title;
this.title = this.title || this.items.title;
this.isPrimitive = this.items.isPrimitive;
if (this.example === undefined && this.items.example !== undefined) {
this.example = [this.items.example];
@ -232,7 +232,7 @@ function buildFields(
required,
schema: {
...field,
default: field.default || defaults[fieldName],
default: field.default === undefined ? defaults[fieldName] : field.default,
},
},
$ref + '/properties/' + fieldName,