-
-
Notifications
You must be signed in to change notification settings - Fork 132
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
Werkzeug validate_request: 'request' argument is not type of Request #806
Comments
Hi @htmhmeer can you provide working example. Your code doesn't show what type of |
The problem is that the system (Odoo) has a wrapper around the original werkzeug request so I tried making a new one with the original environ variable or using the original wrapped one, both methods give the same error when validating or unamrshalling, the WerkzeugOpenAPIRequest does work fine though. The thing is though, I think unmarshal would work perfectly fine if that openapi-core check wouldn't be there. |
If I do |
Because it's made for werkzeug request You can try to extract original request from it. Alternatively Nnthing stopping you from creating your own class for the wrapper based on |
Actual Behavior
openapi_request = WerkzeugOpenAPIRequest(request)
type of openapi_request: openapi_core.contrib.werkzeug.requests.WerkzeugOpenAPIRequest
openapi.validate_request(openapi_request)
│ File "/home/odoo/.local/lib/python3.8/site-packages/openapi_core/app.py", line 347, in validate_request
│ self.validate_apicall_request(request)
│ File "/home/odoo/.local/lib/python3.8/site-packages/openapi_core/app.py", line 359, in validate_apicall_request
│ raise TypeError("'request' argument is not type of Request")
Expected Behavior
that it works like documentated here:
https://openapi-core.readthedocs.io/en/latest/integrations/werkzeug.html
Steps to Reproduce
see above
OpenAPI Core Version
Version: 0.19.0
OpenAPI Core Integration
Werkzeug
Affected Area(s)
No response
References
No response
Anything else we need to know?
am I missing something?
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: