Skip to content

Remove unnecessary camel case conversion for query params #701

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

Merged
merged 1 commit into from
Feb 12, 2025

Conversation

nicky1038
Copy link
Contributor

@nicky1038 nicky1038 commented Apr 19, 2024

There was a change introduced in the 13.0.0 major release. Since that release all query parameter names are being renamed into camelCase. It is a way wrong behavior.

Why is it wrong? Say, a backend server expects a query parameter called a.b. In the Swagger schema provided by that server, that query parameter is also called a.b. When swagger-typescript-api generates types, it renames the query parameter to aB but does not provide any runtime transform. When user passes aB query parameter, the server obviously cannot recognize it, as it expects a.b.

I cannot understand what task is being solved with that change. Renaming query parameters is not valid at all and breaks logic.

It was suggested in #460. After it was released, numerous users also compained that their clients are generated wrongly.

My PR reverts that change.

@smorimoto
Copy link
Collaborator

Could you rebase to latest main branch?

@nicky1038 nicky1038 force-pushed the prevent-camelcase-query-params branch 2 times, most recently from ed4a65a to 61ddfcc Compare June 19, 2024 22:41
@nicky1038
Copy link
Contributor Author

@smorimoto Hi! Rebase done. Thank you so much for taking over maintenance of this project!

@smorimoto smorimoto requested a review from js2me June 27, 2024 22:56
@smorimoto smorimoto added the bug Something isn't working label Jun 27, 2024
@thefuga
Copy link

thefuga commented Sep 5, 2024

Is anything keeping this from being released? @smorimoto

@george-oakling
Copy link

Hello, this is a blocker for us to upgrade to v13 version.

@smorimoto smorimoto requested a review from Copilot November 20, 2024 00:38
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 1 out of 4 changed files in this pull request and generated no suggestions.

Files not reviewed (3)
  • tests/spec/dot-path-params/snapshots/basic.test.ts.snap: Language not supported
  • tests/spec/sortTypes-false/snapshots/basic.test.ts.snap: Language not supported
  • tests/spec/sortTypes/snapshots/basic.test.ts.snap: Language not supported

@harutlc
Copy link

harutlc commented Nov 30, 2024

this is blocker for me too

@george-oakling
Copy link

Still no response?

@MaximeDetaille
Copy link

I got the same issue ... please merge the PR

@smorimoto smorimoto force-pushed the prevent-camelcase-query-params branch from 61ddfcc to 887d139 Compare February 12, 2025 13:11
Copy link

changeset-bot bot commented Feb 12, 2025

🦋 Changeset detected

Latest commit: 0a71f2b

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

@smorimoto smorimoto changed the title fix: revert e340527 - removed forced renaming query params to camelCase Remove unnecessary camel case conversion for query params Feb 12, 2025
@smorimoto smorimoto force-pushed the prevent-camelcase-query-params branch from 887d139 to 0a71f2b Compare February 12, 2025 13:16
@smorimoto smorimoto merged commit a4015bb into acacode:main Feb 12, 2025
1 check passed
@github-actions github-actions bot mentioned this pull request Feb 12, 2025
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.

6 participants