Skip to content

Automatic OpenAPI 404 response #78

@greyli

Description

@greyli

The idea is, if an endpoint's URL rule contains a variable, then add a 404 response for it:

@app.get('/pets/<id>')
def get_pet(id):
    pass

So user don't need to set a 404 response manually:

@app.get('/pets/<id>')
@doc(responses=[404])
def get_pet(id):
    pass

Also, add a config to control this behavior:

AUTO_404_RESPONSE: bool = True

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions