Raml Java Parser


#1

Hi,

I am trying to parse the https://github.com/mulesoft/raml-tutorial-200/blob/master/jukebox-api.raml document with https://github.com/raml-org/raml-java-parser. All files are are on my local system.

private static void parseRaml() throws Exception {
InputStream inStream = new FileInputStream(new File("/home/admin/Downloads/raml-tutorial-200-master/jukebox-api.raml"));
Raml raml = new RamlDocumentBuilder().build(inStream);

The above code gives the following exception

Exception in thread “main” java.lang.RuntimeException: resource not found: jukebox-include-song.schema
at org.raml.parser.visitor.YamlDocumentBuilder.onCustomTagError(YamlDocumentBuilder.java:307)
at org.raml.parser.tagresolver.IncludeResolver.resolve(IncludeResolver.java:68)
at org.raml.parser.visitor.NodeVisitor.resolveTag(NodeVisitor.java:162)
at org.raml.parser.visitor.NodeVisitor.doVisitMappingNode(NodeVisitor.java:139)
at org.raml.parser.visitor.NodeVisitor.visitMappingNode(NodeVisitor.java:86)
at org.raml.parser.visitor.NodeVisitor.visit(NodeVisitor.java:218)
at org.raml.parser.visitor.NodeVisitor.visitResolvedNode(NodeVisitor.java:180)
at org.raml.parser.visitor.NodeVisitor.visitSequence(NodeVisitor.java:247)
at org.raml.parser.visitor.NodeVisitor.visit(NodeVisitor.java:226)
at org.raml.parser.visitor.NodeVisitor.visitResolvedNode(NodeVisitor.java:180)
at org.raml.parser.visitor.NodeVisitor.doVisitMappingNode(NodeVisitor.java:151)
at org.raml.parser.visitor.NodeVisitor.visitDocument(NodeVisitor.java:209)
at org.raml.parser.visitor.YamlDocumentBuilder.build(YamlDocumentBuilder.java:90)
at org.raml.parser.visitor.YamlDocumentBuilder.build(YamlDocumentBuilder.java:113)
at org.raml.parser.visitor.YamlDocumentBuilder.build(YamlDocumentBuilder.java:119)
at com.xxxxx.document.transform.document_transformer.App.parseRaml(App.java:39)
at com.xxxxx.document.transform.document_transformer.App.main(App.java:34)

The resource file jukebox-include-song.schema is there in the same directory where raml document exists.

Does it mean that https://github.com/raml-org/raml-java-parser does not support raml document which are having external resources?

Thanks


#2

It definitely handles external resources… although I am not sure off hand the issue you are having is happening though.


#3