Skip to content

Conversation

javadzarezadeh
Copy link

I believe that using status codes via FastAPI (Starlette, actually!) instead of using raw numbers is more readable, consistent, and makes development easier.

Re-request from PR #1319.

@javadzarezadeh

This comment was marked as resolved.

@alejsdev alejsdev changed the title Changing all status codes from raw numbers to using fastapi.status (closed #1319) ♻️ Changing all status codes from raw numbers to using fastapi.status Jul 5, 2025
YuriiMotov

This comment was marked as resolved.

@javadzarezadeh
Copy link
Author

Thank you, @YuriiMotov.
I've made the changes you requested. I even changed the numbers in ranges to starlette HTTP codes. If you still think that numbers are better for ranges. Let me know. I'll revert it quickly.

@github-actions github-actions bot removed the waiting label Sep 4, 2025
@YuriiMotov YuriiMotov changed the title ♻️ Changing all status codes from raw numbers to using fastapi.status ♻️ Changing all status codes from raw numbers to using constants from status Sep 4, 2025
Copy link

@YuriiMotov YuriiMotov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Still not sure about ranges.
I think we should leave numbers for

assert 200 <= r.status_code < 300

But these changes are in separate commit. Can be easily reverted

@javadzarezadeh, thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants