Parse fails on non-unique nicknames.
bedge opened this issue · 1 comments
The app docs: https://github.com/mission-liao/pyswagger/blob/develop/docs/md/ref/app.md state:
call an API when its nickname is unique
App.op['getPetById']
call an API when its nickname collid with other resources
...
which implies that a non-unique nickname is OK.
However, on parsing, if nicknames are not used within the API, the parse fails if they are non-unique:
api_applications = App.create('./api_name.json')
...
~/.pyenv/versions/3.6.5/envs/3.6/lib/python3.6/site-packages/pyswagger/spec/v1_2/objects.py in init(self, ctx)
269 name = op.nickname
270 if name in new_api.keys():
--> 271 raise ValueError('duplication operation found: ' + name)
272
273 # Operation objects now have 'path' attribute.ValueError: duplication operation found: get
Admittedly, not what I would have chosen for a nickname, but I'm dealing with a foreign API I have no control over.
@bedge Yep, it's a behavior to tolerate the different between Swagger 1.2 to 2.0. But this exception should only raise when duplicated nickname found in the same resource, and it's unexpected. For example:
# OK
pet.updatePet
user.updatePet
# NOK
pet.updatePet
pet.updatePet
Could you check if this is your case, if not, could you help to provide a reproducible example?