rjsf-team / react-jsonschema-form

A React component for building Web forms from JSON Schema.

Home Page:https://rjsf-team.github.io/react-jsonschema-form/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

array of objects with various schemas?

madickson opened this issue · comments

Is it possible to define an array of objects that use different schemas? I've included an example of the model I'm working with, basically a "sections" array that stores objects of various schemas. The user would be able to add a new object to the array and choose what type (schema) to use.

{
  sections: [ // array of objects with multiple possible schemas
    {
      type: 'foo', // enum [foo, bar, baz], decides what props are available in options onChange
      options: {
        ... // varies depending on the type property above
      }
    }
  ]
}

I think this is a duplicate of #52.