aiohttp-apispec icon indicating copy to clipboard operation
aiohttp-apispec copied to clipboard

Custom fields for marshmallow plugin

Open prokaktus opened this issue 4 years ago • 3 comments

Hello!

I've spend some time and cannot figure out, how to register custom fields for apispec through aiohttp-apispec library.

Docs about this at apispec: https://apispec.readthedocs.io/en/latest/using_plugins.html#custom-fields

But MarshmallowPlugin created inside AiohttpApiSpec and not exposed explicitly.

What do you think about instantiating MarshmallowPlugin at module level or put into global context? It will allows me to import this plugin and decorate my own custom fields.

Thanks for your attention!

prokaktus avatar Nov 08 '19 13:11 prokaktus

@maximdanilchenko what do you think about this? Should I prepare PR for this case?

prokaktus avatar Nov 11 '19 09:11 prokaktus

@prokaktus, hi!

Yes, I think that instantiating MarshmallowPlugin at module level is a good idea. You can make a PR, it would be great.

maximdanilchenko avatar Nov 11 '19 15:11 maximdanilchenko

Hi! Any progress on this?

muffinmad avatar Jan 20 '22 14:01 muffinmad