Skip to content

Commit

Permalink
fix: allow strings in json schema (#8524)
Browse files Browse the repository at this point in the history
  • Loading branch information
viceice committed Feb 3, 2021
1 parent 83a511a commit 68e559c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bin/create-json-schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ function createSingleConfig(option) {
temp.items.enum = option.allowedValues;
}
}
if (option.subType == 'string' && option.allowString === true) {
const items = temp.items;
delete temp.items;
delete temp.type;
temp.oneOf = [{ type: 'array', items }, { ...items }];
}
} else {
if (option.format) {
temp.format = option.format;
Expand Down

0 comments on commit 68e559c

Please sign in to comment.