-
Notifications
You must be signed in to change notification settings - Fork 857
Adding declaration of unions outside type expressions #541
base: master
Are you sure you want to change the base?
Conversation
|
||
| Facet | Descriptions | | ||
|:------|:-------------| | ||
| anyOf | array with the super types of the union. It cannot be empty. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And at least two elements right?
9747073
to
feb4c05
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep,originally there was an items
option for union types, but anyOf
is definitely a better name
@antoniogarrote could you update your PR pls. |
QQ: whats the value of each item inside the |
In my opinion, any valid type declaration should be allowed: anyOf:
- Person | Animal[] Expresses: anyOf:
- Person
- Animal[] Expresses: anyOf:
- type:
Person
- type:
array
items:
Animal Expresses: Etc. At the of the day, if you run the canonical form, all of them become:
|
OK. Maybe we should adjust the description text in the spec with that. Its not really clear. |
That will need to go into a new version of RAML, presumably 1.1, right ? |
Fixes #530
Extends the spec to make it possible to declare a union without using a type expression.
It introduces a new facet
anyOf
to declare the super types of the union.It adds two restrictions to
anyOf
: