pyramid_openapi3 icon indicating copy to clipboard operation
pyramid_openapi3 copied to clipboard

Add support for extra_format_unmarshallers

Open claeyswo opened this issue 10 months ago • 2 comments

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}

claeyswo avatar Mar 27 '24 14:03 claeyswo

This makes sense. Can you prepare a Pull Request with the required changes?

zupo avatar Mar 27 '24 21:03 zupo

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

claeyswo avatar Mar 28 '24 15:03 claeyswo

PR is ready: https://github.com/Pylons/pyramid_openapi3/pull/235

claeyswo avatar Apr 12 '24 11:04 claeyswo