@@ -936,7 +936,9 @@ import {
936936 TestParamWithSchemaRefT,
937937 testParamWithSchemaRefDefaultDecoder,
938938 TestHeaderWithSchemaRefT,
939- testHeaderWithSchemaRefDefaultDecoder
939+ testHeaderWithSchemaRefDefaultDecoder,
940+ TestHeaderOptionalT,
941+ testHeaderOptionalDefaultDecoder
940942} from \\"./requestTypes\\";
941943
942944// This is a placeholder for undefined when dealing with object keys
@@ -963,7 +965,8 @@ export type ApiOperation = TypeofApiCall<TestAuthBearerT> &
963965 TypeofApiCall<TestCustomTokenHeaderT> &
964966 TypeofApiCall<TestWithEmptyResponseT> &
965967 TypeofApiCall<TestParamWithSchemaRefT> &
966- TypeofApiCall<TestHeaderWithSchemaRefT>;
968+ TypeofApiCall<TestHeaderWithSchemaRefT> &
969+ TypeofApiCall<TestHeaderOptionalT>;
967970
968971export type ParamKeys = keyof (TypeofApiParams<TestAuthBearerT> &
969972 TypeofApiParams<TestSimpleTokenT> &
@@ -983,7 +986,8 @@ export type ParamKeys = keyof (TypeofApiParams<TestAuthBearerT> &
983986 TypeofApiParams<TestCustomTokenHeaderT> &
984987 TypeofApiParams<TestWithEmptyResponseT> &
985988 TypeofApiParams<TestParamWithSchemaRefT> &
986- TypeofApiParams<TestHeaderWithSchemaRefT>);
989+ TypeofApiParams<TestHeaderWithSchemaRefT> &
990+ TypeofApiParams<TestHeaderOptionalT>);
987991
988992/**
989993 * Defines an adapter for TypeofApiCall which omit one or more parameters in the signature
@@ -1025,7 +1029,8 @@ export type WithDefaultsT<
10251029 | TestCustomTokenHeaderT
10261030 | TestWithEmptyResponseT
10271031 | TestParamWithSchemaRefT
1028- | TestHeaderWithSchemaRefT,
1032+ | TestHeaderWithSchemaRefT
1033+ | TestHeaderOptionalT,
10291034 K
10301035>;
10311036
@@ -1084,6 +1089,8 @@ export type Client<
10841089 readonly testParamWithSchemaRef: TypeofApiCall<TestParamWithSchemaRefT>;
10851090
10861091 readonly testHeaderWithSchemaRef: TypeofApiCall<TestHeaderWithSchemaRefT>;
1092+
1093+ readonly testHeaderOptional: TypeofApiCall<TestHeaderOptionalT>;
10871094 }
10881095 : {
10891096 readonly testAuthBearer: TypeofApiCall<
@@ -1218,6 +1225,13 @@ export type Client<
12181225 Omit<RequestParams<TestHeaderWithSchemaRefT>, K>
12191226 >
12201227 >;
1228+
1229+ readonly testHeaderOptional: TypeofApiCall<
1230+ ReplaceRequestParams<
1231+ TestHeaderOptionalT,
1232+ Omit<RequestParams<TestHeaderOptionalT>, K>
1233+ >
1234+ >;
12211235 };
12221236
12231237/**
@@ -1669,6 +1683,25 @@ export function createClient<K extends ParamKeys>({
16691683 options
16701684 );
16711685
1686+ const testHeaderOptionalT: ReplaceRequestParams<
1687+ TestHeaderOptionalT,
1688+ RequestParams<TestHeaderOptionalT>
1689+ > = {
1690+ method: \\"get\\",
1691+
1692+ headers: ({ [\\"param\\"]: param }) => ({
1693+ param: param
1694+ }),
1695+ response_decoder: testHeaderOptionalDefaultDecoder(),
1696+ url: ({}) => \`\${basePath}/test-header-optional\`,
1697+
1698+ query: () => withoutUndefinedValues({})
1699+ };
1700+ const testHeaderOptional: TypeofApiCall<TestHeaderOptionalT> = createFetchRequestForApi(
1701+ testHeaderOptionalT,
1702+ options
1703+ );
1704+
16721705 return {
16731706 testAuthBearer: (withDefaults || identity)(testAuthBearer),
16741707 testSimpleToken: (withDefaults || identity)(testSimpleToken),
@@ -1698,7 +1731,10 @@ export function createClient<K extends ParamKeys>({
16981731 testCustomTokenHeader: (withDefaults || identity)(testCustomTokenHeader),
16991732 testWithEmptyResponse: (withDefaults || identity)(testWithEmptyResponse),
17001733 testParamWithSchemaRef: (withDefaults || identity)(testParamWithSchemaRef),
1701- testHeaderWithSchemaRef: (withDefaults || identity)(testHeaderWithSchemaRef)
1734+ testHeaderWithSchemaRef: (withDefaults || identity)(
1735+ testHeaderWithSchemaRef
1736+ ),
1737+ testHeaderOptional: (withDefaults || identity)(testHeaderOptional)
17021738 };
17031739}
17041740"
@@ -2774,7 +2810,9 @@ import {
27742810 TestParamWithSchemaRefT,
27752811 testParamWithSchemaRefDefaultDecoder,
27762812 TestHeaderWithSchemaRefT,
2777- testHeaderWithSchemaRefDefaultDecoder
2813+ testHeaderWithSchemaRefDefaultDecoder,
2814+ TestHeaderOptionalT,
2815+ testHeaderOptionalDefaultDecoder
27782816} from \\"./requestTypes\\";
27792817
27802818// This is a placeholder for undefined when dealing with object keys
@@ -2802,7 +2840,8 @@ export type ApiOperation = TypeofApiCall<TestAuthBearerT> &
28022840 TypeofApiCall<TestCustomTokenHeaderT> &
28032841 TypeofApiCall<TestWithEmptyResponseT> &
28042842 TypeofApiCall<TestParamWithSchemaRefT> &
2805- TypeofApiCall<TestHeaderWithSchemaRefT>;
2843+ TypeofApiCall<TestHeaderWithSchemaRefT> &
2844+ TypeofApiCall<TestHeaderOptionalT>;
28062845
28072846export type ParamKeys = keyof (TypeofApiParams<TestAuthBearerT> &
28082847 TypeofApiParams<TestAuthBearerHttpT> &
@@ -2823,7 +2862,8 @@ export type ParamKeys = keyof (TypeofApiParams<TestAuthBearerT> &
28232862 TypeofApiParams<TestCustomTokenHeaderT> &
28242863 TypeofApiParams<TestWithEmptyResponseT> &
28252864 TypeofApiParams<TestParamWithSchemaRefT> &
2826- TypeofApiParams<TestHeaderWithSchemaRefT>);
2865+ TypeofApiParams<TestHeaderWithSchemaRefT> &
2866+ TypeofApiParams<TestHeaderOptionalT>);
28272867
28282868/**
28292869 * Defines an adapter for TypeofApiCall which omit one or more parameters in the signature
@@ -2866,7 +2906,8 @@ export type WithDefaultsT<
28662906 | TestCustomTokenHeaderT
28672907 | TestWithEmptyResponseT
28682908 | TestParamWithSchemaRefT
2869- | TestHeaderWithSchemaRefT,
2909+ | TestHeaderWithSchemaRefT
2910+ | TestHeaderOptionalT,
28702911 K
28712912>;
28722913
@@ -2927,6 +2968,8 @@ export type Client<
29272968 readonly testParamWithSchemaRef: TypeofApiCall<TestParamWithSchemaRefT>;
29282969
29292970 readonly testHeaderWithSchemaRef: TypeofApiCall<TestHeaderWithSchemaRefT>;
2971+
2972+ readonly testHeaderOptional: TypeofApiCall<TestHeaderOptionalT>;
29302973 }
29312974 : {
29322975 readonly testAuthBearer: TypeofApiCall<
@@ -3068,6 +3111,13 @@ export type Client<
30683111 Omit<RequestParams<TestHeaderWithSchemaRefT>, K>
30693112 >
30703113 >;
3114+
3115+ readonly testHeaderOptional: TypeofApiCall<
3116+ ReplaceRequestParams<
3117+ TestHeaderOptionalT,
3118+ Omit<RequestParams<TestHeaderOptionalT>, K>
3119+ >
3120+ >;
30713121 };
30723122
30733123/**
@@ -3549,6 +3599,25 @@ export function createClient<K extends ParamKeys>({
35493599 options
35503600 );
35513601
3602+ const testHeaderOptionalT: ReplaceRequestParams<
3603+ TestHeaderOptionalT,
3604+ RequestParams<TestHeaderOptionalT>
3605+ > = {
3606+ method: \\"get\\",
3607+
3608+ headers: ({ [\\"param\\"]: param }) => ({
3609+ param: param
3610+ }),
3611+ response_decoder: testHeaderOptionalDefaultDecoder(),
3612+ url: ({}) => \`\${basePath}/test-header-optional\`,
3613+
3614+ query: () => withoutUndefinedValues({})
3615+ };
3616+ const testHeaderOptional: TypeofApiCall<TestHeaderOptionalT> = createFetchRequestForApi(
3617+ testHeaderOptionalT,
3618+ options
3619+ );
3620+
35523621 return {
35533622 testAuthBearer: (withDefaults || identity)(testAuthBearer),
35543623 testAuthBearerHttp: (withDefaults || identity)(testAuthBearerHttp),
@@ -3579,7 +3648,10 @@ export function createClient<K extends ParamKeys>({
35793648 testCustomTokenHeader: (withDefaults || identity)(testCustomTokenHeader),
35803649 testWithEmptyResponse: (withDefaults || identity)(testWithEmptyResponse),
35813650 testParamWithSchemaRef: (withDefaults || identity)(testParamWithSchemaRef),
3582- testHeaderWithSchemaRef: (withDefaults || identity)(testHeaderWithSchemaRef)
3651+ testHeaderWithSchemaRef: (withDefaults || identity)(
3652+ testHeaderWithSchemaRef
3653+ ),
3654+ testHeaderOptional: (withDefaults || identity)(testHeaderOptional)
35833655 };
35843656}
35853657"
0 commit comments