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
Support for Swagger 2.0 requests #101
Conversation
analogue
commented
Apr 21, 2015
- Swagger 1.2 is not in the code path at all.
- tween20.py created to isolate Swagger 2.0 support
- Manually tested using example_happyhour and works wonderfully
- using requirements.txt for deps until packaged on pypi
…ustom renderer for /swagger.json since it has embedded jsonrefs - fixed py27 test failures.
|
1 similar comment
|
@dnephin Think this is ready to go on the request side. I have another branch which is for the response side of things. Let me know what you think. |
'validate_path', | ||
'exclude_paths', | ||
'exclude_routes', | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks identical to the one in tween.py
, (except for spec vs schema name). Could we use the one in tween.py for now, and rename it to schema
to spec
at some point later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack
I think this looks good. With the proposed changes it could be just three functions ( |
|
1 similar comment
|
1 similar comment
|
validator_map) | ||
validation_context=validation_context, | ||
validator_map=op_or_validators_map, | ||
op=op_or_validators_map) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is passing the same argument in twice, why not just use positional args and pass it in once?
|
validate_response(response, validator_map.response) | ||
swagger_handler.handle_response( | ||
response, | ||
validator=getattr(op_or_validators_map, 'response', None)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could remove this getattr
by adjusting the validate_response()
to take the op_or_validators_map
instead, but that seems fine to wait until the response branch.
lgtm |
Support for Swagger 2.0 requests