instantiate only `AutoUi` with `schema`
Closed this issue · 2 comments
jgunstone commented
currently everything must be instantiated with schema
which doesn't make much sense...
e.g.
AutoArray
must be an array:EditGrid
must be an arrayAutoObject
must be an object
.. etc. so they should be instantiated with what makes sense for the them -
ie..AutoArray
- itemsEditGrid
- itemsAutoObject
- properties
AutoUi is the top level - in doesn't care what it generates, so this should still be instantiated with schema.
probably makes sense to add a .from_schema
method to the other objects to ease transition...
jgunstone commented
instead of instantiating with schema
use AutoArray (**kwargs)
and ensure that the class has the correct traits
i.e.
- AutoObject requires
properties
trait - AutoArray requires
items
trait