mulesoft-labs / raml-for-jax-rs

This project is all about two way transformation of JAX-RS-annotated Java code to RAML API description and back.
Other
295 stars 181 forks source link

RAML inclusions are unusable in RAML -> JAX-RS #72

Closed ddossot closed 9 years ago

ddossot commented 9 years ago

I can't find a way to use use RAML inclusions, like for example for including common resource types.

Using this sample RAML file (and its related included file) as a sample, I can't find a way for the raml-jaxrs-maven-plugin to work.

Both RAML files in the same directory

So basically no way to use this feature :crying_cat_face:

ddossot commented 9 years ago

Oh and I've tried renaming resource-type-sequence.yaml to resource-type-sequence.inc to prevent the codegen plugin to pick it up but then the RAML Java parser does not interpret the file as YAML and thus does not !include it correctly.

petrochenko-pavel-a commented 9 years ago

Actually it is clearly duplicate of #61. But thanks for detailed description

ddossot commented 9 years ago

So the issue that using sourceDirectory actually loads the RAML files in it and its subdirectories is covered by #61 ?

petrochenko-pavel-a commented 9 years ago

yep, you are right it is a different one. Going to work on both now.

petrochenko-pavel-a commented 9 years ago

File selector checks for #%RAML at the start of the file before actually going to generation from now. (by convention each root RAML file should have it at the start)

ddossot commented 9 years ago

It works, yes, but only if the file being included does not have the RAML stanza.

I'm fine with this limitation but be aware that it contradicts the spec where inclusion examples are shown with the stanza in the included files: https://github.com/raml-org/raml-spec/blob/master/raml-0.8.md#includes

usarid commented 9 years ago

I don't think there's anything in the spec that would forbid including a file that has its own RAML version indication at the top. Perhaps it's not clear enough in the spec whether the inclusion should check whether the versions are the same, whether it should just treat it as any other YAML comment and ignore it, or whether it should be seen as an error since you cannot have a version indication not at the root level. YAML itself would regard this as just a comment and ignore it, even in the root file, so there's no help we get from YAML itself. Perhaps this should be clarified in the RAML spec project first. Can you please file the question there?

On Tue, Apr 28, 2015 at 9:04 AM, David Dossot notifications@github.com wrote:

It works, yes, but only if the file being included does not have the RAML stanza.

I'm fine with this limitation but be aware that it contradicts the spec where inclusion examples are shown with the stanza in the included files: https://github.com/raml-org/raml-spec/blob/master/raml-0.8.md#includes

— Reply to this email directly or view it on GitHub https://github.com/mulesoft/raml-for-jax-rs/issues/72#issuecomment-97120075 .

bmbadrinath commented 6 years ago

How to read .raml file without maven dependency.code executed fine by maven project but as a normal jav project getting below error Exception in thread "main" java.lang.NoClassDefFoundError: org.raml.v2.api.loader.ResourceLoader