raml-java-parser
raml-java-parser copied to clipboard
Same API instance for all version
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