-
-
Notifications
You must be signed in to change notification settings - Fork 272
Implement serializedBody on request options
#2406
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
|
|
🦋 Changeset detectedLatest commit: 04fc0f3 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 |
|
@dovca is attempting to deploy a commit to the Hey API Team on Vercel. A member of the Team first needs to authorize it. |
commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2406 +/- ##
==========================================
- Coverage 22.46% 22.46% -0.01%
==========================================
Files 324 324
Lines 31956 31975 +19
Branches 1234 1234
==========================================
+ Hits 7179 7182 +3
- Misses 24768 24784 +16
Partials 9 9
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:
|
|
Just leaving a note that I've seen this and will come back to review and merge |
mrlubos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix #2395
This PR implements a new property on request options:
serializedBody. It introduces the following BREAKING CHANGE:When accessing
options.bodyin request or response interceptors, the value is now the original raw value passed to the request. Previously, if abodySerializerwas specified,options.bodywould have the serialized value. This only affects thefetchandnextclients.nuxtandaxiosclients have their own ways of defining interceptors that are out of the scope of this package.One might argue, that the previous serialized value was correct, because that was the real value actually passed to the fetch function. However, each generated API request function is strictly typed and replacing the body with its serialized version goes against that.
No previously available information is lost, because now both raw and serialized bodies are available.
I also defined a new
ResolvedRequestOptionsinterface to emphasize the difference between the input options for each request and a transformed version meant for reading back.