Skip to content

Commit

Permalink
feat(io-ts-http): support boolean and string arrays for headers
Browse files Browse the repository at this point in the history
  • Loading branch information
louib-bitgo committed Jan 15, 2025
1 parent 5210a57 commit b6993fb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/io-ts-http/src/httpRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ export const GenericHttpRequest = optionalized({
// DISCUSS: renaming this to something more specific, e.g. route, or path, or routeParams, or pathParams
params: t.record(t.string, t.string),
query: t.record(t.string, t.union([t.string, t.array(t.string)])),
headers: optional(t.record(t.string, t.string)),
headers: optional(
t.record(t.string, t.union([t.string, t.boolean, t.array(t.string)])),
),
body: optional(Json),
});

Expand Down Expand Up @@ -42,7 +44,7 @@ type EmitOutputTypeErrors<

type QueryValue = string | string[] | undefined;
type ParamValue = string | undefined;
type HeaderValue = string | undefined;
type HeaderValue = string | string[] | boolean | undefined;

type EmitPropsErrors<P extends HttpRequestCombinatorProps> = {
params?: EmitOutputTypeErrors<P['params'], ParamValue, 'string | undefined'>;
Expand Down

0 comments on commit b6993fb

Please sign in to comment.