cyprieng / swagger-parser

Give useful informations about your swagger files
MIT License
62 stars 59 forks source link

When parsing an Operation object, swagger-parser requires the optional 'tags' field #12

Closed zdelagrange closed 8 years ago

zdelagrange commented 8 years ago

See the stack trace below. When trying to parse an Operation object, swagger-parser requires there to be a non-empty tag field associated with it. Since the tag field is optional, the parser should handle the tag field either being empty or non-existent.

File "local/lib/python2.7/site-packages/swagger_parser/swagger_parser.py", line 72, in __init__ self.get_paths_data() File "local/lib/python2.7/site-packages/swagger_parser/swagger_parser.py", line 363, in get_paths_data self.operation[path_spec[action]['operationId']] = (path, action, path_spec[action]['tags'][0]) IndexError: list index out of range

flavianh commented 8 years ago

Seems pretty straightforward, how do you feel about submitting a pull request to fix this particular issue?

zdelagrange commented 8 years ago

Will make a fork in the next few days and submit one. Didn't have time today, but I wanted to at least add an issue. On Mar 15, 2016 6:40 PM, "Flavian Hautbois" notifications@github.com wrote:

Seems pretty straightforward, how do you feel about submitting a pull request to fix this particular issue?

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/Trax-air/swagger-parser/issues/12#issuecomment-197055813

flavianh commented 8 years ago

Great, we'll include that in the next release then! Which one of our other libraries do you use this one with if I may be curious?

zdelagrange commented 8 years ago

Just started taking a look at swagger testing today. We have a few swagger apis and started thinking about testing at scale without much overhead, and this seems to be a good start at that.

flavianh commented 8 years ago

If you come across missing features, let us know 😉 Le 15 mars 2016 23:46, "zdelagrange" notifications@github.com a écrit :

Just started taking a look at swagger testing today. We have a few swagger apis and started thinking about testing at scale without much overhead, and this seems to be a good start at that.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/Trax-air/swagger-parser/issues/12#issuecomment-197057177