[Bug]: DjangoOpenAPIResponse
no longer type compatible with unmarshal_response
#938
Labels
kind/bug
Indicates an issue
Actual Behavior
There is a type error here when using
werkzeug
Version 3.1.2 or newer:Expected Behavior
No type errors in the provided sample code.
Steps to Reproduce
Typecheck the provided sample code using mypy.
OpenAPI Core Version
3.0.0
OpenAPI Core Integration
django
Affected Area(s)
casting, dependencies, unmarshalling
References
Anything else we need to know?
werkzeug
Version 3.1.2 changed the definition ofHeaders
because it isn't technically aMutableMapping
.The
Response
protocol inopenapi_core
here hasMapping[str, Any]
:openapi-core/openapi_core/protocols.py
Lines 122 to 123 in b8f0644
DjangoOpenAPIResponse
has headers typed asHeaders
fromwerkzeug
:openapi-core/openapi_core/contrib/django/responses.py
Lines 33 to 35 in b8f0644
Since these are no longer compatible,
unmarshal_response
can no longer acceptDjangoOpenAPIResponse
as a response parameter without failing typechecking.Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: