Skip to content

🐛 Fix path parameters being replaced by same-named local variables#79

Merged
savannahostrowski merged 3 commits intomainfrom
fix-string-variables
Feb 25, 2026
Merged

🐛 Fix path parameters being replaced by same-named local variables#79
savannahostrowski merged 3 commits intomainfrom
fix-string-variables

Conversation

@savannahostrowski
Copy link
Member

@savannahostrowski savannahostrowski commented Feb 25, 2026

In #66, I made it so that we resolve the AST and grab any string variables that may be used in path definitions (see #49). However, this wasn't scoped tightly enough as variables assigned inside functions, classes, and lambdas could inadvertently replace path parameters of the same name (e.g. integration = "redis" inside a handler replacing {integration} in the route path). This fix uses an intermediate representation with sentinel values (\uE000) to differentiate between path parameters in string literals and bare name identifier references, so only the latter are ever substituted.

@savannahostrowski savannahostrowski added the bug Something isn't working label Feb 25, 2026
@savannahostrowski savannahostrowski changed the title 🐛 Avoid using string assignments from within functions 🐛 Fix path parameters being replaced by same-named local variables Feb 25, 2026
@savannahostrowski savannahostrowski merged commit 0094a4d into main Feb 25, 2026
5 checks passed
@savannahostrowski savannahostrowski deleted the fix-string-variables branch February 25, 2026 20:04
@savannahostrowski savannahostrowski self-assigned this Feb 25, 2026
@savannahostrowski savannahostrowski added this to the 2026-Q1 milestone Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant