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

Same API instance for all version

Open amitbhoraniya opened this issue 8 years ago • 0 comments

I want to parse raml and want to create client call. I am not sure end user will use it with version V08 or V10 raml format. Now for both version I am getting different API object so everywhere it creates duplicate and conditional code. For example to get BaseURL:

if (result.isVersion08()) {
    org.raml.v2.api.model.v08.api.Api api = result.getApiV08();
    System.out.println(api.baseUri().value());
} else {
   org.raml.v2.api.model.v10.api.Api api = result.getApiV10();
   System.out.println(api.baseUri().value());
}

Is there any workaround so I can get same API instance so I can use it further independent of versions.

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

amitbhoraniya avatar Feb 13 '17 12:02 amitbhoraniya