mokkabonna / json-schema-merge-allof

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

Need a config option to allow not merging certain `allOf` schemas #23

Open eliaslevy opened 4 years ago

eliaslevy commented 4 years ago

allOf schemas using multiple conditional schemas using if, then, and else cannot be merged. E.g.

  allOf:
    - if:   { properties: { foo: { const: true } } }
      then: { required: [ bar ] }
    - if:   { properties: { xyz: { const: true } } }
      then: { required: [ abc ] } 

There is no way to write a resolver for if and then.

If would be useful to have an option that tell the library to skip trying to resolve certain schema keys and leave them in the allOf.