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

Bug - invalid sort option in /candidates/totals/ throws 500 error when it should be 422 error #5479

Closed
2 tasks done
lbeaufort opened this issue Jun 22, 2023 · 0 comments · Fixed by #5509
Closed
2 tasks done
Assignees
Milestone

Comments

@lbeaufort
Copy link
Member

lbeaufort commented Jun 22, 2023

What we’re after

Invalid sort options should return 422 (uprocessible entity) errors like this: https://api.open.fec.gov/v1/candidates/?api_key=DEMO_KEY&sort=-test&per_page=10&sort_hide_null=true&election_full=true&is_active_candidate=true&page=1

Screenshot 2023-07-18 at 3 21 44 PM

This result returns a server error: https://api.open.fec.gov/v1/candidates/totals/?api_key=DEMO_KEY&sort=-test&per_page=10&sort_hide_null=true&election_full=true&is_active_candidate=true&page=1

Action item(s)

  • Add validator to args

Completion criteria

  • The api returns 422 when user enters invalid sort option
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants