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

Support complete custom response spec #458

Merged
merged 1 commit into from
Jul 23, 2023
Merged

Support complete custom response spec #458

merged 1 commit into from
Jul 23, 2023

Conversation

greyli
Copy link
Member

@greyli greyli commented Jul 22, 2023

Enhance the doc decorator to support passing a complete response spec for the responses parameter. For example:

@app.doc(responses={
    404: {
        'description': 'Custom error',
        'content': {
            'application/json': {
                'schema': SomeErrorSchema
            }
        }
    }
})

fixes #327

Checklist:

  • Add tests that demonstrate the correct behavior of the change. Tests should fail without the change.
  • Add or update relevant docs, in the docs folder and in code docstring.
  • Add an entry in CHANGES.md summarizing the change and linking to the issue.
  • Add *Version changed* or *Version added* note in any relevant docs and docstring.
  • Run pytest and tox, no tests failed.

@greyli greyli added this to the 2.0.0 milestone Jul 22, 2023
@greyli greyli added this to In progress in APIFlask 2.0 via automation Jul 22, 2023
@greyli greyli merged commit d4070eb into main Jul 23, 2023
15 checks passed
APIFlask 2.0 automation moved this from In progress to Done Jul 23, 2023
@greyli greyli deleted the doc-responses branch July 23, 2023 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Support multiple responses with different response codes and schemes
1 participant