Adding declaration of unions outside type expressions#541
Adding declaration of unions outside type expressions#541antoniogarrote wants to merge 1 commit intoraml-org:masterfrom
Conversation
|
|
||
| | Facet | Descriptions | | ||
| |:------|:-------------| | ||
| | anyOf | array with the super types of the union. It cannot be empty. | |
There was a problem hiding this comment.
And at least two elements right?
9747073 to
feb4c05
Compare
petrochenko-pavel-a
left a comment
There was a problem hiding this comment.
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:
AnimalExpresses: 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
anyOfto declare the super types of the union.It adds two restrictions to
anyOf: