svelte-jsonschema-form
svelte-jsonschema-form copied to clipboard
Flesh out `anyOf` support
Currently support for anyOf
is a bit limited. I believe it's just a dropdown that switches child fields based on which "anyOf" option is selected. When a new one is selected, the previous set values persist. These should probably be "cleared out" whenever a new option is selected.
Actually, this would ideally be how the "oneOf" would work and "anyOf" would allow one to select multiple options and set the values for each of these (and clear out associated values when unselected). There are a few complications here to keep in mind - like there can be values for say, an object
type, that are not part of the anyOf
options. Also the different options could have overlapping values, where we probably want one field for this. Likewise you could have anyOf
s without actual properties like outlined in issue #6 .
Probably want to look at how other similar libraries handle this (e.g. (react-jsonschema-form)[https://rjsf-team.github.io/react-jsonschema-form/] and (JSONForms)[https://jsonforms.io/]).