Skip to content

Request headers and cookies parameter parsing fix #46

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

Merged
merged 2 commits into from
Aug 13, 2018
Merged

Request headers and cookies parameter parsing fix #46

merged 2 commits into from
Aug 13, 2018

Conversation

HoverHell
Copy link
Contributor

OpenAPI 3 spec uses 'header' and 'cookie' as parameter location.

@codecov
Copy link

codecov bot commented Jun 12, 2018

Codecov Report

Merging #46 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master     #46   +/-   ##
======================================
  Coverage    98.5%   98.5%           
======================================
  Files          52      52           
  Lines        1069    1069           
======================================
  Hits         1053    1053           
  Misses         16      16
Impacted Files Coverage Δ
openapi_core/wrappers/flask.py 96.55% <ø> (ø) ⬆️
openapi_core/validation/request/models.py 88.23% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8f22b6a...f8e977c. Read the comment docs.

@p1c2u
Copy link
Collaborator

p1c2u commented Jun 18, 2018

@HoverHell thanks for the contribution. That's big change. We need to cover it with tests.

@HoverHell
Copy link
Contributor Author

That's big change. We need to cover it with tests.

Were there tests previously covering this?

What I did is, I tried to use a openapi_core.validation.request.validators.RequestValidator over a openapi_core.wrappers.mock.MockRequest, and found out that it raises an error when parsing the schema I was using. The schema, however, was valid (as validated, e.g., by editor.swagger.io).

In other words, it seemed as if this part never worked correctly. Or did it?

@p1c2u
Copy link
Collaborator

p1c2u commented Jun 18, 2018

@HoverHell this part was never covered that's why it would be good to cover it

@HoverHell
Copy link
Contributor Author

That's big change

Apparently it's not even a change as much as it's a fix.
Compare:
https://github.com/p1c2u/openapi-core/blob/4e1a61aaceaad026c74044ae2285f26f666521bd/tests/unit/schema/test_paramters.py#L25-L32

(also, that filename is mistyped)

@p1c2u
Copy link
Collaborator

p1c2u commented Jul 9, 2018

Added tests for renames

@p1c2u p1c2u merged commit ac797bc into python-openapi:master Aug 13, 2018
bjmc pushed a commit to bjmc/openapi-core that referenced this pull request Jun 12, 2019
Request headers and cookies parameter parsing fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants