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

Fix route param parsing when the param begins with just one letter (rebased original PR #686 by @ahoseinian) #1064

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

nicky1038
Copy link
Contributor

@nicky1038 nicky1038 commented Feb 22, 2025

Fixes the way how query params are parsed when they consist of one letter or the first letter is followed by underscore.

Original #686 by @ahoseinian was needed to be rebased.

So I did it myself because of no activity there.

For example if the param was i_key the current regex would not find it as a variable. it was only working for the params with more than one letter before either `.` `-` or `_`. the fix should allow to find params with only one letter at begninng.
Copy link

changeset-bot bot commented Feb 22, 2025

🦋 Changeset detected

Latest commit: 1fd32de

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
swagger-typescript-api Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@nicky1038 nicky1038 force-pushed the bugfix/fix-route-path-params-parsing branch from aebb1d3 to a0205f6 Compare February 22, 2025 19:57
@nicky1038 nicky1038 force-pushed the bugfix/fix-route-path-params-parsing branch from 11ba2f3 to 1fd32de Compare February 22, 2025 20:18
@nicky1038
Copy link
Contributor Author

Things done in this PR that were not in the original one:

  • Allowed leading chars [ \ ] ^ ` _ in query param regex for backwards compatibility. In the old regex the leading symbol was [A-z], and these chars also match this regex.
  • Updated snapshots
  • Added changeset

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants