check format first (#2851)

default to number
This commit is contained in:
David Tsay 2020-03-31 21:04:52 -07:00 committed by GitHub
parent ee4a81bdfd
commit a81af1ce34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -201,6 +201,8 @@ export default {
if (foundMetadata.enumerations !== undefined) {
this.operationFormat = 'enum';
this.enumerations = foundMetadata.enumerations;
} else if (foundMetadata.format === 'string' || foundMetadata.format === 'number') {
this.operationFormat = foundMetadata.format;
} else if (foundMetadata.hints.hasOwnProperty('range')) {
this.operationFormat = 'number';
} else if (foundMetadata.hints.hasOwnProperty('domain')) {
@ -208,7 +210,7 @@ export default {
} else if (foundMetadata.key === 'name') {
this.operationFormat = 'string';
} else {
this.operationFormat = 'string';
this.operationFormat = 'number';
}
}
this.updateInputVisibilityAndValues();