jdiegodcp / ramlfications

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

Errors aren't collected for multiple items being validated #51

Open econchick opened 8 years ago

econchick commented 8 years ago

For instance, if I had a RAML file in which it defined three protocols, two of which are invalid (aka not HTTP or HTTPS):

#%RAML 0.8
title: Example Web API
# <--snip-->
protocols: [HTTP, FTP, SSH]
# <--snip-->

Then running ramlfications validate api.raml on it, I see:

Error validating file api.raml: 

    InvalidRootNodeError: 'FTP' not a valid protocol for a RAML-defined API.

I would expect the following:

Error validating file api.raml: 

    InvalidRootNodeError: 'FTP' not a valid protocol for a RAML-defined API.
    InvalidRootNodeError: 'SSH' not a valid protocol for a RAML-defined API.

I haven't checked but I assume that this probably doesn't work for other items that are lists, like is: for traits.

@cerivera - perhaps you have some thoughts?