raml-js-parser-2
raml-js-parser-2 copied to clipboard
documentation required for api interface
below link has all API interface but documentation and their usage of interface is not clear enough https://raml-org.github.io/raml-js-parser-2/interfaces/src_raml1_artifacts_raml10parserapi.api.html#version
please provide some documentation to use the interface
Hi @NandaBalakrishnan !
The basics of operating with AST are explained inthe Getting Started Guide. Examples of the guide do not cover the whole AST, but the missing parts do behave themselve similar to the covered ones.
Roughly, the documentation provides the complete set of possible actions, and the guide gives some examples of using them.
Regards, Konstantin
it is better to provide the guide for missing parts
Honestly, I have struggled badly in figuring out what I can do with the result of parseSync. I am reduced to having JS list the available methods and guessing which ones might be relevant, and what values I might pass to the parameters. For example, nothing in the documentation gave me any idea that I get the list of HTTP from a resource using resource.elementsOfKind('methods'), the the result of this is a JavaScript array rather than some kind of set-of-methods node, or that the way to get the actual HTTP method out of one of the objects in that array is methodObject.name(). I had to figure all that out by trial and error.
I hate to be ungrateful, because this is obviously fine software. But it's incredibly hard to learn. Are there any externally written tutorials that I should be be reading instead of this site?
Note that raml-js-parser-2 has been deprecated, the new official parser is webapi-parser. Feel free to report any documentation issues you may have on that repository.