Closed juancoen closed 8 years ago
This is the code that uses the parser:
parser.loadApi(resolve(process.cwd(), filename), {attributeDefaults: true, rejectOnErrors: true})
.then(function (raml) {
var apiJSON;
raml = raml.expand ? raml.expand() : raml;
apiJSON = raml.toJSON({serializeMetadata: false});
console.log(JSON.stringify(apiJSON, null, 2));
})
.catch(function (err) {
console.log('Error found: ' + err);
console.error(JSON.stringify(err, null, 2));
process.exit(1);
});
RAML
Library:
JSON:
Note that traits is included in the RAML, but queryParameters are not expanded into the methods that use the trait.