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.
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