diff --git a/.changeset/tall-bees-impress.md b/.changeset/tall-bees-impress.md index b87d8a1..4547b25 100644 --- a/.changeset/tall-bees-impress.md +++ b/.changeset/tall-bees-impress.md @@ -1,5 +1,5 @@ --- -"typed-openapi": minor +"typed-openapi": patch --- Add options to `Method` type in `generateApiClient` function as fix for diff --git a/packages/typed-openapi/tests/generator.test.ts b/packages/typed-openapi/tests/generator.test.ts index f492d33..e5042a1 100644 --- a/packages/typed-openapi/tests/generator.test.ts +++ b/packages/typed-openapi/tests/generator.test.ts @@ -276,7 +276,7 @@ describe("generator", () => { }; export type MutationMethod = "post" | "put" | "patch" | "delete"; - export type Method = "get" | "head" | MutationMethod; + export type Method = "get" | "head" | "options" | MutationMethod; type RequestFormat = "json" | "form-data" | "form-url" | "binary" | "text"; diff --git a/packages/typed-openapi/tests/snapshots/docker.openapi.client.ts b/packages/typed-openapi/tests/snapshots/docker.openapi.client.ts index b16e82d..d548c03 100644 --- a/packages/typed-openapi/tests/snapshots/docker.openapi.client.ts +++ b/packages/typed-openapi/tests/snapshots/docker.openapi.client.ts @@ -2199,7 +2199,7 @@ export type EndpointParameters = { }; export type MutationMethod = "post" | "put" | "patch" | "delete"; -export type Method = "get" | "head" | MutationMethod; +export type Method = "get" | "head" | "options" | MutationMethod; type RequestFormat = "json" | "form-data" | "form-url" | "binary" | "text"; diff --git a/packages/typed-openapi/tests/snapshots/docker.openapi.io-ts.ts b/packages/typed-openapi/tests/snapshots/docker.openapi.io-ts.ts index fd6265d..4f07ce3 100644 --- a/packages/typed-openapi/tests/snapshots/docker.openapi.io-ts.ts +++ b/packages/typed-openapi/tests/snapshots/docker.openapi.io-ts.ts @@ -3614,7 +3614,7 @@ export type EndpointParameters = { }; export type MutationMethod = "post" | "put" | "patch" | "delete"; -export type Method = "get" | "head" | MutationMethod; +export type Method = "get" | "head" | "options" | MutationMethod; type RequestFormat = "json" | "form-data" | "form-url" | "binary" | "text"; diff --git a/packages/typed-openapi/tests/snapshots/docker.openapi.typebox.ts b/packages/typed-openapi/tests/snapshots/docker.openapi.typebox.ts index a8e8ac3..2971cde 100644 --- a/packages/typed-openapi/tests/snapshots/docker.openapi.typebox.ts +++ b/packages/typed-openapi/tests/snapshots/docker.openapi.typebox.ts @@ -3865,7 +3865,7 @@ export type EndpointParameters = { }; export type MutationMethod = "post" | "put" | "patch" | "delete"; -export type Method = "get" | "head" | MutationMethod; +export type Method = "get" | "head" | "options" | MutationMethod; type RequestFormat = "json" | "form-data" | "form-url" | "binary" | "text"; diff --git a/packages/typed-openapi/tests/snapshots/docker.openapi.valibot.ts b/packages/typed-openapi/tests/snapshots/docker.openapi.valibot.ts index 8c5b3ba..49112b3 100644 --- a/packages/typed-openapi/tests/snapshots/docker.openapi.valibot.ts +++ b/packages/typed-openapi/tests/snapshots/docker.openapi.valibot.ts @@ -3532,7 +3532,7 @@ export type EndpointParameters = { }; export type MutationMethod = "post" | "put" | "patch" | "delete"; -export type Method = "get" | "head" | MutationMethod; +export type Method = "get" | "head" | "options" | MutationMethod; type RequestFormat = "json" | "form-data" | "form-url" | "binary" | "text"; diff --git a/packages/typed-openapi/tests/snapshots/docker.openapi.yup.ts b/packages/typed-openapi/tests/snapshots/docker.openapi.yup.ts index 1c8042a..83e5e85 100644 --- a/packages/typed-openapi/tests/snapshots/docker.openapi.yup.ts +++ b/packages/typed-openapi/tests/snapshots/docker.openapi.yup.ts @@ -4039,7 +4039,7 @@ export type EndpointParameters = { }; export type MutationMethod = "post" | "put" | "patch" | "delete"; -export type Method = "get" | "head" | MutationMethod; +export type Method = "get" | "head" | "options" | MutationMethod; type RequestFormat = "json" | "form-data" | "form-url" | "binary" | "text"; diff --git a/packages/typed-openapi/tests/snapshots/docker.openapi.zod.ts b/packages/typed-openapi/tests/snapshots/docker.openapi.zod.ts index 67fa813..79bb730 100644 --- a/packages/typed-openapi/tests/snapshots/docker.openapi.zod.ts +++ b/packages/typed-openapi/tests/snapshots/docker.openapi.zod.ts @@ -3518,7 +3518,7 @@ export type EndpointParameters = { }; export type MutationMethod = "post" | "put" | "patch" | "delete"; -export type Method = "get" | "head" | MutationMethod; +export type Method = "get" | "head" | "options" | MutationMethod; type RequestFormat = "json" | "form-data" | "form-url" | "binary" | "text"; diff --git a/packages/typed-openapi/tests/snapshots/long-operation-id.arktype.ts b/packages/typed-openapi/tests/snapshots/long-operation-id.arktype.ts index db8ca8d..eecc248 100644 --- a/packages/typed-openapi/tests/snapshots/long-operation-id.arktype.ts +++ b/packages/typed-openapi/tests/snapshots/long-operation-id.arktype.ts @@ -61,7 +61,7 @@ export type EndpointParameters = { }; export type MutationMethod = "post" | "put" | "patch" | "delete"; -export type Method = "get" | "head" | MutationMethod; +export type Method = "get" | "head" | "options" | MutationMethod; type RequestFormat = "json" | "form-data" | "form-url" | "binary" | "text"; diff --git a/packages/typed-openapi/tests/snapshots/long-operation-id.client.ts b/packages/typed-openapi/tests/snapshots/long-operation-id.client.ts index 4ee2be9..bc3a33e 100644 --- a/packages/typed-openapi/tests/snapshots/long-operation-id.client.ts +++ b/packages/typed-openapi/tests/snapshots/long-operation-id.client.ts @@ -53,7 +53,7 @@ export type EndpointParameters = { }; export type MutationMethod = "post" | "put" | "patch" | "delete"; -export type Method = "get" | "head" | MutationMethod; +export type Method = "get" | "head" | "options" | MutationMethod; type RequestFormat = "json" | "form-data" | "form-url" | "binary" | "text"; diff --git a/packages/typed-openapi/tests/snapshots/long-operation-id.io-ts.ts b/packages/typed-openapi/tests/snapshots/long-operation-id.io-ts.ts index 72e53b6..6538cb3 100644 --- a/packages/typed-openapi/tests/snapshots/long-operation-id.io-ts.ts +++ b/packages/typed-openapi/tests/snapshots/long-operation-id.io-ts.ts @@ -57,7 +57,7 @@ export type EndpointParameters = { }; export type MutationMethod = "post" | "put" | "patch" | "delete"; -export type Method = "get" | "head" | MutationMethod; +export type Method = "get" | "head" | "options" | MutationMethod; type RequestFormat = "json" | "form-data" | "form-url" | "binary" | "text"; diff --git a/packages/typed-openapi/tests/snapshots/long-operation-id.typebox.ts b/packages/typed-openapi/tests/snapshots/long-operation-id.typebox.ts index 43d546f..749f554 100644 --- a/packages/typed-openapi/tests/snapshots/long-operation-id.typebox.ts +++ b/packages/typed-openapi/tests/snapshots/long-operation-id.typebox.ts @@ -59,7 +59,7 @@ export type EndpointParameters = { }; export type MutationMethod = "post" | "put" | "patch" | "delete"; -export type Method = "get" | "head" | MutationMethod; +export type Method = "get" | "head" | "options" | MutationMethod; type RequestFormat = "json" | "form-data" | "form-url" | "binary" | "text"; diff --git a/packages/typed-openapi/tests/snapshots/long-operation-id.valibot.ts b/packages/typed-openapi/tests/snapshots/long-operation-id.valibot.ts index 8f44307..65d55fc 100644 --- a/packages/typed-openapi/tests/snapshots/long-operation-id.valibot.ts +++ b/packages/typed-openapi/tests/snapshots/long-operation-id.valibot.ts @@ -57,7 +57,7 @@ export type EndpointParameters = { }; export type MutationMethod = "post" | "put" | "patch" | "delete"; -export type Method = "get" | "head" | MutationMethod; +export type Method = "get" | "head" | "options" | MutationMethod; type RequestFormat = "json" | "form-data" | "form-url" | "binary" | "text"; diff --git a/packages/typed-openapi/tests/snapshots/long-operation-id.yup.ts b/packages/typed-openapi/tests/snapshots/long-operation-id.yup.ts index ca961a0..3201ca2 100644 --- a/packages/typed-openapi/tests/snapshots/long-operation-id.yup.ts +++ b/packages/typed-openapi/tests/snapshots/long-operation-id.yup.ts @@ -50,7 +50,7 @@ export type EndpointParameters = { }; export type MutationMethod = "post" | "put" | "patch" | "delete"; -export type Method = "get" | "head" | MutationMethod; +export type Method = "get" | "head" | "options" | MutationMethod; type RequestFormat = "json" | "form-data" | "form-url" | "binary" | "text"; diff --git a/packages/typed-openapi/tests/snapshots/long-operation-id.zod.ts b/packages/typed-openapi/tests/snapshots/long-operation-id.zod.ts index 6a95782..478714a 100644 --- a/packages/typed-openapi/tests/snapshots/long-operation-id.zod.ts +++ b/packages/typed-openapi/tests/snapshots/long-operation-id.zod.ts @@ -50,7 +50,7 @@ export type EndpointParameters = { }; export type MutationMethod = "post" | "put" | "patch" | "delete"; -export type Method = "get" | "head" | MutationMethod; +export type Method = "get" | "head" | "options" | MutationMethod; type RequestFormat = "json" | "form-data" | "form-url" | "binary" | "text"; diff --git a/packages/typed-openapi/tests/snapshots/petstore.arktype.ts b/packages/typed-openapi/tests/snapshots/petstore.arktype.ts index 0d217e0..e95c513 100644 --- a/packages/typed-openapi/tests/snapshots/petstore.arktype.ts +++ b/packages/typed-openapi/tests/snapshots/petstore.arktype.ts @@ -368,7 +368,7 @@ export type EndpointParameters = { }; export type MutationMethod = "post" | "put" | "patch" | "delete"; -export type Method = "get" | "head" | MutationMethod; +export type Method = "get" | "head" | "options" | MutationMethod; type RequestFormat = "json" | "form-data" | "form-url" | "binary" | "text"; diff --git a/packages/typed-openapi/tests/snapshots/petstore.client.ts b/packages/typed-openapi/tests/snapshots/petstore.client.ts index dff7e48..7e41f49 100644 --- a/packages/typed-openapi/tests/snapshots/petstore.client.ts +++ b/packages/typed-openapi/tests/snapshots/petstore.client.ts @@ -266,7 +266,7 @@ export type EndpointParameters = { }; export type MutationMethod = "post" | "put" | "patch" | "delete"; -export type Method = "get" | "head" | MutationMethod; +export type Method = "get" | "head" | "options" | MutationMethod; type RequestFormat = "json" | "form-data" | "form-url" | "binary" | "text"; diff --git a/packages/typed-openapi/tests/snapshots/petstore.io-ts.ts b/packages/typed-openapi/tests/snapshots/petstore.io-ts.ts index 83a4282..d1904a7 100644 --- a/packages/typed-openapi/tests/snapshots/petstore.io-ts.ts +++ b/packages/typed-openapi/tests/snapshots/petstore.io-ts.ts @@ -367,7 +367,7 @@ export type EndpointParameters = { }; export type MutationMethod = "post" | "put" | "patch" | "delete"; -export type Method = "get" | "head" | MutationMethod; +export type Method = "get" | "head" | "options" | MutationMethod; type RequestFormat = "json" | "form-data" | "form-url" | "binary" | "text"; diff --git a/packages/typed-openapi/tests/snapshots/petstore.typebox.ts b/packages/typed-openapi/tests/snapshots/petstore.typebox.ts index ca3b4e4..b1b226b 100644 --- a/packages/typed-openapi/tests/snapshots/petstore.typebox.ts +++ b/packages/typed-openapi/tests/snapshots/petstore.typebox.ts @@ -392,7 +392,7 @@ export type EndpointParameters = { }; export type MutationMethod = "post" | "put" | "patch" | "delete"; -export type Method = "get" | "head" | MutationMethod; +export type Method = "get" | "head" | "options" | MutationMethod; type RequestFormat = "json" | "form-data" | "form-url" | "binary" | "text"; diff --git a/packages/typed-openapi/tests/snapshots/petstore.valibot.ts b/packages/typed-openapi/tests/snapshots/petstore.valibot.ts index 9c19236..363cb34 100644 --- a/packages/typed-openapi/tests/snapshots/petstore.valibot.ts +++ b/packages/typed-openapi/tests/snapshots/petstore.valibot.ts @@ -364,7 +364,7 @@ export type EndpointParameters = { }; export type MutationMethod = "post" | "put" | "patch" | "delete"; -export type Method = "get" | "head" | MutationMethod; +export type Method = "get" | "head" | "options" | MutationMethod; type RequestFormat = "json" | "form-data" | "form-url" | "binary" | "text"; diff --git a/packages/typed-openapi/tests/snapshots/petstore.yup.ts b/packages/typed-openapi/tests/snapshots/petstore.yup.ts index d59d54b..ee0f11d 100644 --- a/packages/typed-openapi/tests/snapshots/petstore.yup.ts +++ b/packages/typed-openapi/tests/snapshots/petstore.yup.ts @@ -379,7 +379,7 @@ export type EndpointParameters = { }; export type MutationMethod = "post" | "put" | "patch" | "delete"; -export type Method = "get" | "head" | MutationMethod; +export type Method = "get" | "head" | "options" | MutationMethod; type RequestFormat = "json" | "form-data" | "form-url" | "binary" | "text"; diff --git a/packages/typed-openapi/tests/snapshots/petstore.zod.ts b/packages/typed-openapi/tests/snapshots/petstore.zod.ts index 54219f4..7e1f3ae 100644 --- a/packages/typed-openapi/tests/snapshots/petstore.zod.ts +++ b/packages/typed-openapi/tests/snapshots/petstore.zod.ts @@ -358,7 +358,7 @@ export type EndpointParameters = { }; export type MutationMethod = "post" | "put" | "patch" | "delete"; -export type Method = "get" | "head" | MutationMethod; +export type Method = "get" | "head" | "options" | MutationMethod; type RequestFormat = "json" | "form-data" | "form-url" | "binary" | "text";