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