-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ValueError when two operations have the same tag and similar operation IDs. #129
Comments
This part is done in pyswagger.utils.ScopeDict, to workaround it: You need to pass both app.op['Utica', 'hobbies-get']
app.op['Albany', 'get'] And maybe I can still fix your use case, let me investigate it this weekend. |
The workaround works. Please let me know when you have fixed the problem. Thanks! |
The fix is released in v0.8.32 and your use case is added to test case. |
I upgraded to v0.8.32, removed my primitive hack, and re-tested. It works. Thank you for your quick attention to this! |
When my swagger has two paths with the same tag, and similar operation IDs, pyswagger raises a ValueError when I try to execute one of them.
Here is a swagger.json, which is the standard pet store example, expanded to demonstrate this problem:
Here is what happens when I try to execute the first operation, 'get':
Some debugging reveals the duplicate keys to be : 'Albany!##!get' and 'Utica!##!hobbies-get'.
These are not duplicate keys, just similar keys. And the tags are totally different. In fact, it doesn't matter what the tags are; as long as both paths have any tag, this exception is raised.
According to the Swagger spec, the operationId is:
My reading of this is that an operation ID is all that is necessary to identify an operation, and thus I can't figure out why this exception is being raised.
Can you explain why two similar but unique operation IDs are resulting in this duplicate-key exception?
And is there a way to work around it?
Thanks.
The text was updated successfully, but these errors were encountered: