raml-org / raml-js-parser

(deprecated) A RAML parser based on PyYAML written in CoffeScript and available for use as NodeJs module or in-browser.
195 stars 53 forks source link

Error parsing: while validating trait properties resource type cannot define child resources #178

Open priyavivek1 opened 8 years ago

priyavivek1 commented 8 years ago

"Error parsing: while validating trait properties resource type cannot define child resources". I am getting this error while parsing RAML using raml-js-parser.

Seems to be working fine in Java but getting this issues in Javascript one.

Sample RAML:

/abc: type: Sample description: individual-to-party relationships

It throws following error

Error parsing: while validating trait properties resource type cannot define child resources in "1.1.4/ramlName", line 690, column 7: /{key}: ^

Seems RAML specification is correct as per RAML0.8 but parser gives errror

dmartinezg commented 8 years ago

What the error is saying is that a resource type or trait MAY NOT have a child resource inside.

Without the full RAML, it is hard to pinpoint the exact syntax error, but in Sample (which is a resource type), you are defining a /{key} child resource.

If you can provide a small, full RAML example with the error, it may be easier to point you to the syntax error.