svelte-jsonschema-form icon indicating copy to clipboard operation
svelte-jsonschema-form copied to clipboard

anyOf without visual components

Open brollb opened this issue 2 years ago • 0 comments
trafficstars

This isn't terribly pressing but I wanted to make an issue for what we saw yesterday. Basically, it is possible for anyOf to be used in JSONSchema to ensure other constraints about an object. In yesterday's example, we were trying to ensure that at least one key was required in an object. The suggested solution was to do something like this:

{
  "anyOf": [
    { "required": ["key1"] },
    { "required": ["key2"] },
    // ...
    { "required": ["keyN"] }
  ]
}

brollb avatar Aug 29 '23 13:08 brollb