Skip to content

Commit

Permalink
JSON RE: fix pattern fields handling
Browse files Browse the repository at this point in the history
  • Loading branch information
mtseluiko committed Jan 29, 2021
1 parent 57406cf commit 65310e1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions reverse_engineering/helpers/adaptJsonSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,10 @@ const handleEmptyDefaultInProperties = field => {
return { ...properties, [key]: updatedProperty };
}

const complexProperties = ['properties', 'items'];
const complexProperties = ['patternProperties', 'properties', 'items'];

const propertyWithChoice = {
..._.omit(updatedProperty, complexProperties),
..._.omit(updatedProperty, [ ...complexProperties, 'type' ]),
oneOf: updatedProperty.type.map(type => {
if (!isComplexType(type)) {
return {
Expand All @@ -138,7 +138,7 @@ const handleEmptyDefaultInProperties = field => {
}

return {
..._.omit(updatedProperty, type === 'array' ? 'properties' : 'items'),
..._.omit(updatedProperty, type === 'array' ? ['patternProperties', 'properties'] : 'items'),
type
};
})
Expand Down

0 comments on commit 65310e1

Please sign in to comment.