fix(server): harden tools and chatmessage route contracts#6429
Open
sahil2448 wants to merge 2 commits into
Open
fix(server): harden tools and chatmessage route contracts#6429sahil2448 wants to merge 2 commits into
sahil2448 wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request simplifies the routing logic in the chat-messages and tools modules by replacing array-based route definitions with single, parameterized paths. Specifically, it removes the optional root paths from GET, PUT, and DELETE endpoints, ensuring that these routes now explicitly require an ID or specific parameters. I have no feedback to provide as there were no review comments to evaluate.
Contributor
Author
|
@ maintainers, waiting for Review and Merge if this issue and PR is considerable...! |
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.
Summary
fixes : #6428
This PR removes ambiguous / route variants for handlers that require :id, and aligns route definitions with current controller expectations.
Even though normal frontend flows were already working, these route definitions were still inconsistent and could cause avoidable 412 errors for future integrations or refactors.
What changed
Files changed
Why this matters
Controllers for these handlers already require req.params.id.
Previous route setup accepted both / and /:id, which made the API contract ambiguous.
Calling / for id-required handlers could hit controller logic and fail with 412 (id not provided) instead of being clearly non-matching at the route layer.
This change makes behavior predictable and safer for future clients and tests.
Compatibility and risk
Validation
Checklist