Fix/regex in path params - #64
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
AI Code Review by LlamaPReview
🎯 TL;DR & Recommendation
Recommendation: Approve with suggestions
This PR fixes a bug in path parameter parsing when regex constraints are present. The regex change correctly isolates the parameter name, and tests have been added for the new behavior, though some edge cases remain uncovered.
🌟 Strengths
- Solid fix: regex correctly isolates param name before
:, reducing risk of validation errors. - Tests added for primary scenarios.
💡 Suggestions (P2)
- internal/builder/builder.go: The regex change extracts the param name correctly, but the regex itself is not unit-tested, which could let edge cases (e.g., empty constraints, escaped braces) slip through and cause future bugs.
- internal/validate/utils_test.go: New tests cover basic regex constraints but omit edge cases like empty constraints and escaped braces, reducing regression confidence.
💡 Have feedback? We'd love to hear it in our GitHub Discussions.
✨ This review was generated by LlamaPReview Advanced, which is free for all open-source projects. Learn more.
GamerGirlandCo
force-pushed
the
fix/regex-in-path-params
branch
3 times, most recently
from
July 17, 2026 23:48
65eb795 to
51e0123
Compare
GamerGirlandCo
force-pushed
the
fix/regex-in-path-params
branch
from
July 18, 2026 00:00
51e0123 to
9444311
Compare
akfaiz
self-requested a review
July 25, 2026 10:59
Member
|
Hi @GamerGirlandCo , thanks for your contribution. |
akfaiz
approved these changes
Jul 25, 2026
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.
Description
this PR fixes a bug where path/template params with regex constraints (
/sub/path/{type:something|orother}) are parsed incorrectly, resulting in validation errors when trying to marshal documents to YAML/JSON. given the previous example,{type:something|orother}would result in a template param with the nametype:something|orother, instead oftype.Type of Change
Checklist
make checkpasses locally (sync + tidy + lint + test)make test-update)