We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
params
pathParams
1 parent 5f70d75 commit dc554daCopy full SHA for dc554da
2 files changed
.changeset/long-colts-switch.md
@@ -0,0 +1,5 @@
1
+---
2
+'@ts-rest/core': patch
3
4
+
5
+Fix `params` resolving as `any` when `pathParams` is missing and zod is not installed
libs/ts-rest/core/src/lib/infer-types.ts
@@ -51,14 +51,14 @@ type PathParamsFromUrl<T extends AppRoute> = ParamsFromUrl<
51
type PathParamsWithCustomValidators<
52
T extends AppRoute,
53
TClientOrServer extends 'client' | 'server' = 'server',
54
-> = T['pathParams'] extends undefined
55
- ? PathParamsFromUrl<T>
56
- : Merge<
+> = 'pathParams' extends keyof T
+ ? Merge<
57
PathParamsFromUrl<T>,
58
TClientOrServer extends 'server'
59
? ZodInferOrType<T['pathParams']>
60
: ZodInputOrType<T['pathParams']>
61
- >;
+ >
+ : PathParamsFromUrl<T>;
62
63
export type ResolveResponseType<
64
T extends
0 commit comments