-
-
Notifications
You must be signed in to change notification settings - Fork 273
fix: allow per field array parameters for serializeQuery #2837
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
Conversation
…on overrides Introduces a 'parameters' option to QuerySerializerOptions, allowing per-parameter overrides for array, object, and allowReserved settings in query serialization. Updates generated clients and tests to support and demonstrate this new capability.
|
|
🦋 Changeset detectedLatest commit: 780dbe9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
@pixelmord is attempting to deploy a commit to the Hey API Team on Vercel. A member of the Team first needs to authorize it. |
|
Hmm, why is the OpenAI example still causing issues... I ignored it here https://github.com/hey-api/openapi-ts/blob/main/eslint.config.js#L67 so I expect it to be in sync with |
|
@pixelmord Is your branch based on the latest from main? I updated the ESLint config yesterday I think, pull it locally and regenerate one more time if you're not on the latest |
|
@pixelmord Did you investigate why that one parameter produces a custom config? I'm not clear where the "form" style comes from, the spec doesn't seem to be defining it and it's not the default for objects... otherwise the feature itself looks really good! |
@mrlubos not sure, I have to say I am not very familiar with the codebase, I was a bit flying blind. I just did a code search to find the spots where the querySerializer is constructed and and applied and changed that to a map for every field. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2837 +/- ##
==========================================
- Coverage 30.39% 30.36% -0.03%
==========================================
Files 485 485
Lines 39764 39803 +39
Branches 2413 2413
==========================================
Hits 12088 12088
- Misses 27645 27684 +39
Partials 31 31
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Sounds good, I'll take it from here! |
…/querySerializer
|
Leaving this here for my own reference openapi-ts/openapi-typescript@2bbeb92#r168790715 |
f13d6c3 to
f191079
Compare
Updated the serialization strategy for query parameters to allow for more granular control.
commit: |
|
Thx very appreciated! @mrlubos |
|
Thank YOU! |
Fixes: #1804
Instead of just using one universal setting for array parameters in the serializer this introduces per field parameters to support uneven explode config.
Changes
Replaced global query serialization overrides with per-parameter configuration.
Before: Generated a single global querySerializer override that applied to all parameters,
breaking on the first array parameter needing custom serialization.
After: Generates parameter-specific serialization configs under
querySerializer.parameters[paramName], allowing different style and explode settings per query
parameter.
Implementation:
settings (arrays not using form/explode=true, objects not using deepObject/explode=true)
settings