-
-
Notifications
You must be signed in to change notification settings - Fork 266
WIP: Support 'response' return for openapi-ts plugins #2935
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
base: main
Are you sure you want to change the base?
WIP: Support 'response' return for openapi-ts plugins #2935
Conversation
|
|
🦋 Changeset detectedLatest commit: 69f219f The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
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 |
|
@abuyukyi101198 is attempting to deploy a commit to the Hey API Team on Vercel. A member of the Team first needs to authorize it. |
|
@abuyukyi101198 Doesn't |
Add a changeset for WIP support of 'response' return in openapi-ts plugins.
I don't think so. The else-case seems to destructure to get { data } and return that. if (plugin.getPluginOrThrow('@hey-api/sdk').config.responseStyle === 'data') {
statements.push(
tsc.returnVariable({
expression: awaitSdkExpression,
}),
);
} else {
statements.push(
tsc.constVariable({
destructure: true,
expression: awaitSdkExpression,
name: 'data',
}),
tsc.returnVariable({
expression: 'data',
}),
);
} |
|
@mrlubos Using 'data' picks for the data field within the SDK, either way other fields of the response like headers seem to be discarded from what I understand. |
…' into response-return-for-tanstack-sdk
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2935 +/- ##
==========================================
- Coverage 27.95% 27.95% -0.01%
==========================================
Files 346 346
Lines 33374 33380 +6
Branches 1921 1921
==========================================
Hits 9330 9330
- Misses 24017 24023 +6
Partials 27 27
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:
|
commit: |
|
@mrlubos All tests pass, slightly reduced coverage |
Added a 'response' option for the @hey-api/sdk config responseStyle parameter. Setting responseStyle to 'response' should directly return awaitSdkExpression without destructuring { data }, while keeping the SDK function returns the same.
Fixes: #2070