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

Raml Emitter truncates trait definition

Open mpindyala opened this issue 11 years ago • 0 comments

We are seeing a behavior where we put traits in single file inline. When I am calling the dump using emitter it is emitting empty traits with just display name . I am using version 0.8.9. Please help.

Steps:

  1. Create Raml object with proper traits using RamlDocumentBuilder

2.Feed Raml object with traits to emitter 2. call dump method on emitter 3. You will see empty traits 4. Emitted raml has traits with just displayname and missing the main definition

Code RamlDocumentBuilder ramlBuilder = new RamlDocumentBuilder(); RamlEmitter re = new RamlEmitter(); try (Reader r = new FileReader(new File(getClass().getClassLoader() .getResource("test.raml").getFile()))) { Raml raml = ramlBuilder.build(r, null); System.out.print(re.dump(raml));

} finally {

}

Input Trait sample traits:

tokenTrait: headers: authToken: description: A valid authToken is required required: true type: string authVerifier: description: A valid authVerifier string is required required: true type: string authTokenSecret: description: A valid authTokenSecret string is required required: true type: string

Output from emitter

traits:

"tokenTrait": displayName: "tokenTrait"

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

mpindyala avatar Oct 09 '14 00:10 mpindyala