raml-java-parser icon indicating copy to clipboard operation
raml-java-parser copied to clipboard

Resource has no urlParameters (v2)

Open aweisser opened this issue 9 years ago • 4 comments

Shouldn't this test pass?

https://gist.github.com/aweisser/05442f28bad33265cca2fb2cfd94d324

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

aweisser avatar Jul 29 '16 20:07 aweisser

the uriParameters() method only returns the parameters explicitly declared in the uriParameters section of the resource in question

svacas avatar Aug 06 '16 22:08 svacas

Thanks for the response. What would be the proper method to access those parametrized path segments?

aweisser avatar Aug 07 '16 07:08 aweisser

there's not much help on that front in the public api, you could try something like this on the relative uri: https://github.com/raml-org/raml-java-parser/blob/264c1c25dc86705159f209515a8a6512fc2680a8/raml-parser-2/src/main/java/org/raml/v2/internal/impl/commons/phase/UnusedParametersTransformer.java#L80-L80

you may need to do it recursively on the parent resources to get all the templates

svacas avatar Aug 07 '16 16:08 svacas

In v1 of the raml-java-parser you can access those as uriParameters in the public API (Resource.getUriParameters()).

I suggest to make this a change request for v2. But I can't add labels to the issues.

What do you think? Shouldn't this be part of the public API?

aweisser avatar Aug 07 '16 16:08 aweisser