Skip to content

Include possible HTTPExceptions in OpenAPI spec #9124

Answered by estebanx64
onecrayon asked this question in Questions
Discussion options

You must be logged in to vote

Hi there.

As many others have mentioned, the only way so far is following this section from the doc additional-responses

or even including the responses at a router level.

app.include_router(
    router,
    responses={
        418: {
            "description": "I'm a teapot",
            "content": {"application/json": {"example": {"dummy": "dumdum"}}},
        },
        413: {
            "description": "I'm too large",
            "content": {"application/json": {"example": {"dummy": "dumdum"}}},
        },
    },
)

I'm marking this question as answered and labeling as possible feature. We don't have any due date or whether is gonna be included or not yet

Replies: 20 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

Kludex
Apr 30, 2021
Collaborator Sponsor

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by estebanx64
Comment options

You must be logged in to vote
1 reply
@Rey092
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request question Question or problem investigate question-migrate
Converted from issue

This discussion was converted from issue #1999 on February 28, 2023 18:42.