raml-org / raml-java-parser

(deprecated) A RAML parser based on SnakeYAML written in Java
Other
174 stars 121 forks source link

Property type specialization does not adhere to RAML spec #383

Open vsigler opened 7 years ago

vsigler commented 7 years ago

The RAML spec says, that when subclassing (suptyping), it is possible to override property definitions by narrowing them (e.g. adding facets or changing type - Number to Integer, etc.). There are 2 problems:

1) Type name is lost - if parent type has a property of type object and I narrow it down to a custom object type, the final result "forgets" the new type name and uses the one of the parent. This is especially painful when writing a code generator that works with inheritance. 2) This is much more severe than 1) - according to the spec, "any" type can be specialized to anything, so it is perfectly valid to declare property of type "any" and in a subtype override it to some other type. However, if I do this, I will always get just an instance of AnyTypeDeclaration and the overriding is completely ignored.

Aha! Link: https://mulesoft-roadmap.aha.io/features/APIRAML-86

RangelReale commented 6 years ago

I've had the same problem, the specialized types are not used on the output.