Skip to content
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

Custom fields for marshmallow plugin #68

Open
prokaktus opened this issue Nov 8, 2019 · 3 comments
Open

Custom fields for marshmallow plugin #68

prokaktus opened this issue Nov 8, 2019 · 3 comments

Comments

@prokaktus
Copy link

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
Copy link
Author

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

@maximdanilchenko
Copy link
Owner

@prokaktus, hi!

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

@muffinmad
Copy link

Hi! Any progress on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants