mokkabonna / json-schema-merge-allof

Simplify your schema by combining allOf
97 stars 23 forks source link

Handle non-array allOf gracefully #4

Closed P0lip closed 4 years ago

P0lip commented 5 years ago

The PR addresses an issue with merger running into infinite recursion. getAllOf does not remove allOf property at the moment if it's not an array. It bails out if there is a property with key allOf, but its value is not an array.

mokkabonna commented 4 years ago

Sorry but I don't want to support non valid json schemas. This library assumes a valid schema. There are other tools that you can pass your schemas through to verify validity before using this tool.

Also I think it might have been fixed indirectly by this commit: https://github.com/mokkabonna/json-schema-merge-allof/commit/b69c2bddc2d08407b0c90c886ea51102016cde41#diff-1fdf421c05c1140f6d71444ea2b27638