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

🐛 Fix support for strings in OpenAPI status codes: default, 1XX, 2XX, 3XX, 4XX, 5XX #5187

Merged
2 changes: 1 addition & 1 deletion fastapi/utils.py
Expand Up @@ -19,7 +19,7 @@


def is_body_allowed_for_status_code(status_code: Union[int, str, None]) -> bool:
if status_code is None:
if status_code is None or status_code == "default":
JarroVGIT marked this conversation as resolved.
Show resolved Hide resolved
return True
current_status_code = int(status_code)
return not (current_status_code < 200 or current_status_code in {204, 304})
Expand Down