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

Building models with overlays

Open KevinMitchell opened this issue 8 years ago • 2 comments

Hi, I'm a little confused about how to use the parser with overlays. Suppose I have a master RAML spec M, and then overlays A and B. If I want to work with the model resulting from merging all of these do I first parse M, A and B individually and then call something in the API to merge the models? Or is there some API call I've not noticed that will take all three sources at once and build the combined model? Or ?

Thanks for any hints.

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

KevinMitchell avatar Apr 04 '17 19:04 KevinMitchell

Hi,

If A overlays B and B overlays M, you just need to parse A and the parser will take care of parsing B and M, as long as you have the extends key right and the files are in the right locations.

svacas avatar Apr 05 '17 17:04 svacas

That's fine if we have a chain as you describe. But in many cases the overlays will deal with different aspects. For example one overlay might add in annotations for testing, another for documentation. In these cases there's no relationship between the overlays, and so it's unnatural to require one to extend the other. It's these kinds of cases where I'm having problems figuring out how to use the parser.

KevinMitchell avatar Apr 05 '17 19:04 KevinMitchell