Skip to content

Commit

Permalink
Respect required
Browse files Browse the repository at this point in the history
  • Loading branch information
ardatan committed Jul 24, 2023
1 parent 2e873b2 commit 755498b
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions packages/fets/src/client/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,17 @@ export type OASParamObj<

interface OASParamToRequestParam extends Fn {
return: this['arg0'] extends { name: string; in: infer TParamType }
? {
[TKey in TParamType extends keyof OASParamPropMap
? OASParamPropMap[TParamType]
: never]: OASParamObj<this['arg0']>;
}
? this['arg0'] extends { required: true }
? {
[TKey in TParamType extends keyof OASParamPropMap
? OASParamPropMap[TParamType]
: never]: OASParamObj<this['arg0']>;
}
: {
[TKey in TParamType extends keyof OASParamPropMap
? OASParamPropMap[TParamType]
: never]?: OASParamObj<this['arg0']>;
}
: {};
}

Expand Down

0 comments on commit 755498b

Please sign in to comment.