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

Interest in taking Schema description from Schema.__doc__ docstring #861

Open
ddorian opened this issue Sep 30, 2023 · 0 comments
Open

Interest in taking Schema description from Schema.__doc__ docstring #861

ddorian opened this issue Sep 30, 2023 · 0 comments

Comments

@ddorian
Copy link

ddorian commented Sep 30, 2023

You take the object description from Meta.description in

jsonschema["description"] = Meta.description

Do you have interest in a pull request to also get it from the Schema docstring? Something like:

if hasattr(Meta, "description"):
    jsonschema["description"] = Meta.description
elif schema.__doc__:
    jsonschema["description"] = schema.__doc__

You can do the same formating as in https://flask-smorest.readthedocs.io/en/latest/openapi.html#add-summary-and-description.

Makes sense?

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

1 participant