jdiegodcp / ramlfications

Python parser for RAML
https://ramlfications.readthedocs.org
Apache License 2.0
234 stars 50 forks source link

tests/data/examples/complete-valid-example.raml is not valid #68

Open jenner opened 8 years ago

jenner commented 8 years ago

According to https://github.com/raml-org/raml-js-parser (the RAML reference implementation) the complete-valid-example.raml is not valid at all: misplaced uriParameters, formParameters etc., misformed schema or examples (not strings) and much more. The question is, whether ramlfications should be as strict as possible and comply with 0.8 specs or if it should allow invalid RAML definitions and let the developer decide if those definitions are of any value in the concrete API.

@econchick Thoughts?

jenner commented 8 years ago

I used this to validate complete-valid-example.raml:

sudo npm install -g raml-parser
cat << EOF > check-raml.js
var raml = require('raml-parser');
raml.loadFile('complete-valid-example.raml').then(function(data) {
    console.log(data);
}, function(error) {
    console.log('Error parsing: ' + error);
});
EOF
node check-raml.js
econchick commented 8 years ago

@jenner sorry for the delayed response.

ramlfications has the ability for the developer to turn on/off validation when parsing (undocumented - but should be - although can see a test example), as well as adding certain values to be considered valid. Regardless of of complete-valid-example.raml is or isn't valid, does that answer your main question?

I'll look into complete-valid-example.raml itself as I work on updating ramlfications according to my brand-new-but-not-entirely-finished roadmap. It's a good idea to use other parsers (e.g. the one you linked) for sanity checks.

econchick commented 8 years ago

Definitely confirm some inconsistencies. I'm going to move this to the 0.2.0 release.