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

[Merged by Bors] - Validators endpoint status code #2040

Closed

Conversation

realbigsean
Copy link
Member

Issue Addressed

Resolves #2035

Proposed Changes

Update 405's to 400's for failures when we are parsing path params.

Additional Info

Haven't updated the same for non-standard endpoints

@realbigsean realbigsean changed the base branch from stable to unstable December 2, 2020 16:36
@realbigsean realbigsean added the ready-for-review The code is ready for review label Dec 2, 2020
Copy link
Member

@paulhauner paulhauner left a comment

Choose a reason for hiding this comment

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

I think a block_task is overkill here, this closure is so small we don't need to worry about it blocking the core executor:

        .and(warp::path::param::<ValidatorId>().or_else(|_| async {
            Err(warp_utils::reject::custom_bad_request(
                "Invalid validator ID".to_string(),
            ))
        }))

Let me know your thoughts.

@paulhauner paulhauner added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels Dec 3, 2020
@realbigsean
Copy link
Member Author

Yep, makes sense. Updated.

@realbigsean realbigsean added ready-for-review The code is ready for review and removed waiting-on-author The reviewer has suggested changes and awaits thier implementation. labels Dec 3, 2020
Copy link
Member

@paulhauner paulhauner left a comment

Choose a reason for hiding this comment

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

Nice!

@paulhauner
Copy link
Member

bors r+

@paulhauner paulhauner added ready-for-merge This PR is ready to merge. and removed ready-for-review The code is ready for review labels Dec 3, 2020
bors bot pushed a commit that referenced this pull request Dec 3, 2020
## Issue Addressed

Resolves #2035 

## Proposed Changes

Update 405's to 400's for failures when we are parsing path params.

## Additional Info

Haven't updated the same for non-standard endpoints

Co-authored-by: realbigsean <[email protected]>
@bors bors bot changed the title Validators endpoint status code [Merged by Bors] - Validators endpoint status code Dec 4, 2020
@bors bors bot closed this Dec 4, 2020
@realbigsean realbigsean deleted the validators-endpoint-status-code branch November 21, 2023 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge This PR is ready to merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

validator API endpoint 400 vs 405 status
2 participants