From d71272b25a76f24d4128810bf73411730ba41b77 Mon Sep 17 00:00:00 2001 From: tender <31318219+piousdeer@users.noreply.github.com> Date: Mon, 14 Oct 2024 23:26:56 +0700 Subject: [PATCH] fix(openapi-typescript-helpers): fix SuccessResponseJSON, ErrorResponseJSON and RequestBodyJSON --- .changeset/odd-seahorses-juggle.md | 5 +++++ packages/openapi-typescript-helpers/index.d.ts | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .changeset/odd-seahorses-juggle.md diff --git a/.changeset/odd-seahorses-juggle.md b/.changeset/odd-seahorses-juggle.md new file mode 100644 index 000000000..dffb198f6 --- /dev/null +++ b/.changeset/odd-seahorses-juggle.md @@ -0,0 +1,5 @@ +--- +"openapi-typescript-helpers": patch +--- + +fix SuccessResponseJSON, ErrorResponseJSON and RequestBodyJSON helpers diff --git a/packages/openapi-typescript-helpers/index.d.ts b/packages/openapi-typescript-helpers/index.d.ts index d8e67c501..c6cf5cbd1 100644 --- a/packages/openapi-typescript-helpers/index.d.ts +++ b/packages/openapi-typescript-helpers/index.d.ts @@ -131,13 +131,13 @@ export type ErrorResponse = FilterKeys< >; /** Return first JSON-like 2XX response from a path + HTTP method */ -export type SuccessResponseJSON = SuccessResponse>; +export type SuccessResponseJSON = SuccessResponse, `${string}/json`>; /** Return first JSON-like 5XX or 4XX response from a path + HTTP method */ -export type ErrorResponseJSON = ErrorResponse>; +export type ErrorResponseJSON = ErrorResponse, `${string}/json`>; /** Return JSON-like request body from a path + HTTP method */ -export type RequestBodyJSON = FilterKeys, "content">; +export type RequestBodyJSON = JSONLike, "content">>; // Generic TS utils