fix: stop returning the request body in validation errors - #363
Merged
Merged
Conversation
Signed-off-by: Priyanshu-u07 <connect.priyanshu8271@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
validation_error_handlerreturnedexc.errors()as-is, and Pydantic puts the whole request body under input, so a failed login sent the password back in the 422.Drops input from every validation error. loc, msg and type survive, so clients can still show which field failed.
Two other paths did the same thing: the pool endpoints in deployment_server.py raise HTTPException directly and never reach the handler, so they're fixed too.
Also registers the shared handlers on the unified_web parent app. Its two root routes take no body, so nothing leaks today, but routes added with include_router run on the parent rather than a mount and inherit no handlers from the sub-apps, so the next body-taking route would echo by default. Both routes are browser redirect targets and raise only HTTPException, which FastAPI handles itself, so no existing response changes.
Closes #330