diff --git a/package.json b/package.json index 46088d3..e993f42 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Avro", - "version": "0.1.55", + "version": "0.1.56", "versionDate": "2021-01-29", "author": "hackolade", "engines": { diff --git a/reverse_engineering/helpers/adaptJsonSchema.js b/reverse_engineering/helpers/adaptJsonSchema.js index 6ac2978..dd915e5 100644 --- a/reverse_engineering/helpers/adaptJsonSchema.js +++ b/reverse_engineering/helpers/adaptJsonSchema.js @@ -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 { @@ -138,7 +138,7 @@ const handleEmptyDefaultInProperties = field => { } return { - ..._.omit(updatedProperty, type === 'array' ? 'properties' : 'items'), + ..._.omit(updatedProperty, type === 'array' ? ['patternProperties', 'properties'] : 'items'), type }; })