-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Values can often be one of several datatypes (like string or int, class A or class B, ...).
There should be a way to model unions (anonymous or tagged).
Describing this in the schema is a bit tricky though, since the datatype property is just a single value.
Options:
- allow the
datatypeproperty to be an array of possible types - add an additional property for the
Propertyclass: somehting likealternativeDataTypes - require defining a custom datatype for each union.
There could be aUnionTypeclass which has adatatypesproperty, and custom union datatypes specify "isA: "Union". That's rather awkward though, since you could end up withStringOrInt` etc datatypes , which pollute the readability of a schema quite a bit, and more importantly might be duplicated a lot
Non of these is really ideal.
Curios about alternative thoughts here.
Metadata
Metadata
Assignees
Labels
No labels