pyramid_openapi3
pyramid_openapi3 copied to clipboard
Add support for extra_format_unmarshallers
There is already support for extra_format_validators and extra_media_type_deserializers: https://github.com/Pylons/pyramid_openapi3/blob/ef0df8d1b23f21bff658ac94ba79efdd80202616/pyramid_openapi3/init.py#L329
Is it possible to add similar support for extra_format_unmarshallers?
https://github.com/python-openapi/openapi-core/blob/32ce65739531eea90220aeabbee72096818b9d05/openapi_core/unmarshalling/request/unmarshallers.py#L121
For now we are doing it like this:
config.registry.settings["pyramid_openapi3"][
"request_validator"
].extra_format_unmarshallers = {"search_filter": unmarshal_search_filter}
config.registry.settings["pyramid_openapi3"][
"response_validator"
].extra_format_unmarshallers = {"search_filter": unmarshal_search_filter}
This makes sense. Can you prepare a Pull Request with the required changes?
Sure, while implementing the change I discovered what I believe is a bug in openapi-core so I'm waiting for a fix for that. https://github.com/python-openapi/openapi-core/issues/821
PR is ready: https://github.com/Pylons/pyramid_openapi3/pull/235