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

Adding descriptions to fields #33

Closed
optlink opened this issue Sep 14, 2019 · 1 comment
Closed

Adding descriptions to fields #33

optlink opened this issue Sep 14, 2019 · 1 comment

Comments

@optlink
Copy link

optlink commented Sep 14, 2019

Flask-RESTPlus has the ability to set field descriptions that appear in swagger like so:
https://flask-restplus.readthedocs.io/en/stable/swagger.html#documenting-the-fields
Is something like this possible in flask_accepts with marshmallow? I can't find anything in the documentation and a quick glance over the flask_accepts source indicates that any "metadata" set on a marshmallow field is ignored during the mapping process. I imagine that something like this would be ideal:

from marshmallow import Schema, fields

class SomeSchema(Schema):
    some_field = fields.String(metadata={"description":"Some Field"})

Reference for marshmallow field metadata: https://marshmallow.readthedocs.io/en/stable/api_reference.html#module-marshmallow.fields

Any ideas?

@apryor6
Copy link
Owner

apryor6 commented Sep 14, 2019

Knee jerk reaction is there is no reason this can’t or shouldn’t be done, so I’ll give it a whirl sometime next week if possible. Thanks!

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

2 participants