-
Notifications
You must be signed in to change notification settings - Fork 53
Body type inheritance support #66
Comments
Same issue for traits. I use traits for |
@dennisfoconnor Type declaration AST node itself does not contain parent's properties. Because this node represents what actually is typed by user, the code. var bodyType = api.resources()[0].resources()[0].methods()[0].responses()[0].body()[0];
var runtimeBodyType = bodyType.runtimeType(); You get the instance of ITypeDefinition, which can be asked for super types and properties of the super type like this: Or, if you do not want to bother with super type analysis, you can just ask for all type properties, including the ones defined in the super types: |
@fkrauthan You need to call expand() for your Api in order to apply traits and resource types. |
@ddenisenko Shouldn't expand also resolve custom types? |
2019, still the same problem. I have a response body with custom types and I cannot render the properties of these types which makes the parser pretty useless. |
Note that raml-js-parser-2 has been deprecated, the new official parser is webapi-parser. Feel free to attempt to reproduce this issue with webapi-parser and report any issue you may have on that repository. |
Currently when parsing a method request body or a response body, it appears that the body object does not inherit properties or examples or from the parent type.
Given the following example:
When we run this RAML through through the parser and try to retrieve the body for the response. We get an error.
Ideally the parser should return the properties and example(s) from the parent type.
Is this feature currently on the roadmap?
The text was updated successfully, but these errors were encountered: