Skip to content

Consider removing the status_code field in the default error response #124

@greyli

Description

@greyli

In the automatic error response, there are three fields currently:

  • detail: It will be filled when a validation error happened.
  • message: The HTTP reason phrase.
  • status_code: The HTTP status code.

The status_code seems unnecessary since the HTTP header already contains the status info, and some users may want it in the camel case (it can be achieved with the custom error processor though), so maybe we should just remove it. Users who need it can easily add it back via the custom error processor:

@app.error_processor
def handle_error(error):
    return {
        ...
        'status_code': error.status_code
    }

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions