Skip to content

Commit

Permalink
Merge commit 'refs/pull/20/head' of https://github.com/hackolade/Avro
Browse files Browse the repository at this point in the history
Handling of pattern fields
  • Loading branch information
pdesmarets committed Jan 29, 2021
2 parents 6709cbd + 65310e1 commit eaee577
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Avro",
"version": "0.1.55",
"version": "0.1.56",
"versionDate": "2021-01-29",
"author": "hackolade",
"engines": {
Expand Down
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 eaee577

Please sign in to comment.