fix: change BodySerializer from any to unknown for strict TypeScript support#3471
fix: change BodySerializer from any to unknown for strict TypeScript support#3471
any to unknown for strict TypeScript support#3471Conversation
|
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
…support Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>
…ple files Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>
any to unknown for strict TypeScript support
|
@copilot CI fails on typecheck, please fix. I also think instead of replacing this: bodySerializer: <T extends Record<string, any> | Array<Record<string, any>>>(
body: T,
): FormData => {with this: bodySerializer: (body: unknown): FormData => {you should've done just this: bodySerializer: <T extends Record<string, unknown> | Array<Record<string, unknown>>>(
body: T,
): FormData => { |
Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>
... Fixed in commit
|
|
@copilot tests fail, you probably need to run |
Co-authored-by: mrlubos <12529395+mrlubos@users.noreply.github.com>
Fixed in commit |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3471 +/- ##
=======================================
Coverage 40.15% 40.15%
=======================================
Files 478 478
Lines 17496 17496
Branches 5306 5306
=======================================
Hits 7025 7025
Misses 8421 8421
Partials 2050 2050
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:
|
@hey-api/codegen-core
@hey-api/json-schema-ref-parser
@hey-api/nuxt
@hey-api/openapi-ts
@hey-api/shared
@hey-api/types
@hey-api/vite-plugin
commit: |
BodySerializer = (body: any) => anytoBodySerializer = (body: unknown) => unknownin source bundle filesformDataBodySerializer,jsonBodySerializer,urlSearchParamsBodySerializer) to acceptunknownparameter in both source filesserializedBody: undefinedinitialization by usingundefined as string | undefinedso TypeScript doesn't inferundefinedliteral typeopts.serializedBody = opts.bodySerializer(opts.body) as string | undefinedto explicitly cast theunknownreturn type(body: object)parameter type — changed to(body: unknown)to match newBodySerializersignatureclient.gen.tsfiles with the same fixessse-tanstack-react-querysnapshot files (added in merge from main):core/bodySerializer.gen.ts— updated from oldanytype to newunknowntypeclient/client.gen.ts— updated withas string | undefinedcastsOriginal prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.