Closed juancoen closed 7 years ago
It is clearly bug in the parser. Thanks a lot for reporting this.
I'll close this as invalid.
I ran into this and see this is flagged as invalid, why is this not supported in RAML 1.0?
So as my example is:
types:
Car:
type: object
properties:
brand:
model:
color:
price: number
year: number
example:
brand: Tesla
model: Model S
color: Grey
price: 60000
year: 2014
ElectricCar:
type: Car
properties:
battery:
range: number
unit:
Using API designer on the Anypoint Platform (MuleSoft) the autocompletion options give me the fields of the supertype and subtype. So is this valid? Isn't there an option to include the example from the supertype (Car in this case) and only specify the values that are there regarding the subtype. And if not is there a reason, i saw @petrochenko-pavel-a said is was clearly a bug, so for me the support of this is a bit vague.
Meant to be or not? :)
I've been playing a little bit with examples and noticed that the parser throws a
Required Property
error for each required property in a type's supertype that is not specified in its example, even if the example has been specified in the supertype, for example:However, if the example in User's id property is removed, the parser works fine and the resulting AST returns this example for the User type:
The spec doesn't give a lot of detail on the rules of example definition, so the question is: should this work correctly and it's just a parser error or am I trying to achieve something that is invalid?
Thanks!