Closed ddossot closed 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.
Actually it is clearly duplicate of #61. But thanks for detailed description
So the issue that using sourceDirectory
actually loads the RAML files in it and its subdirectories is covered by #61 ?
yep, you are right it is a different one. Going to work on both now.
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)
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
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 .
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
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
If the Maven plugin is configured with
sourceDirectory
pointing to the directory containing both RAML files, execution dies with:which makes sense because the
resource-type-sequence.yaml
file is designed to be included, not to be loaded standalone.If the Maven plugin is configured with
sourcePaths
pointing to the parent RAML file (include-resource-type-sequence.yaml
) then the execution dies with:ERROR Include cannot be resolved resource-type-sequence.yaml
which does not make sense because the file is in the same directory (probably related to issue #61).
Included RAML file in sub-directory
If the Maven plugin is configured with
sourceDirectory
pointing to the directory containing the parent RAML files, execution dies with:This does not make sense because the included RAML file is now in a sub-directory: it should not be loaded directly by the plugin. Why is the plugin exploring sub-directories for other RAML files?
If the Maven plugin is configured with
sourcePaths
pointing to the parent RAML file (include-resource-type-sequence.yaml
) then the execution dies with:ERROR Include cannot be resolved includes/resource-type-sequence.yaml
which does not make sense because the exists in the
includes
sub directory (probably related to issue #61).So basically no way to use this feature :crying_cat_face: