Repository navigation
Releases
openapi-typesafe@1.0.0-rc.4
Compatibility: 50,960 cases against openapi-typescript 7.13, 0 unexpected differences, 99.87% byte identity and 100% type identity. See the compatibility report.
Minor Changes
-
#49
e12bc23Thanks @fedorello! - An--outputorx-openapi-ts.outputthat cannot be a file fails with the new error code
CLI_OUTPUT_INVALID(exit code2) before anything is generated: a URL of another scheme
(-o https://…), a path that ends with a separator (-o gen/) or with.or..
(-o gen/.), or an existing directory. openapi-typescript failed on them withEISDIRor a
stack trace, or wrote a file named like the directory. An output that cannot be written (a file name too long
for the file system) leaves no new directories behind; openapi-typescript left them. -
#39
a4a1104Thanks @fedorello! - The CLI no longer overwrites a file it should not. Both checks follow symlinks and hard links,
and the letter case of a file system that ignores case (asked of the file system, not assumed from
the OS), also for outputs that do not exist yet. They run before anything is written and fail with
exit code2. openapi-typescript checked neither:- An
--output, or anx-openapi-ts.outputinredocly.yaml, that names a file the CLI
reads fails with the new error codeCLI_OUTPUT_IS_INPUT: the schema, a local file one of
its$refs loads, orredocly.yaml. With several APIs, every API is read before any output
is written, and no output may be a file that any API reads. openapi-typescript replaced the
file with the types. - APIs in
redocly.yamlwhose outputs are the same file all fail with the new error code
CLI_OUTPUT_DUPLICATE; the other APIs are still generated. openapi-typescript let the API
that finished last win. Before writing, the CLI creates every missing output, empty, and asks
the file system whether two of them are one file, so names that differ only in Unicode
normalization or case folding (café.tsin NFC and NFD,straße.tsandSTRASSE.ts) or a
path through a link to a missing directory are caught too. A run that fails this way leaves no
new file or directory.
- An
-
#50
90e2668Thanks @fedorello! - Remote documents have size limits. The loader reads each body as a stream and counts the bytes
aftergzip,deflateorbris decoded, so a compressed "zip bomb" behind a remote$refno
longer fills the memory: 1.6 MB on the wire became 1.6 GB before. A body larger than 128 MiB, or
remote documents larger than 256 MiB together for one schema, fail withSCHEMA_REF_FORBIDDENand
the new reasonsremote-document-too-largeandremote-documents-too-large. The parser also
counts the nodes it builds: remote documents that parse into more than 8,000,000 nodes together
fail with the new reasonremote-documents-too-many-nodes, so a dense body such as
[{},{},…]within the byte limits no longer ends the process with an out-of-memory crash.
The largest real document we know is 71 MiB and 2.65 million nodes. AcustomFetchin the
Redocly config is limited too.
Patch Changes
-
#53
5e1d76aThanks @fedorello! - A key that contains#/, such as a path/items/#/%zz, a propertya#/bor a parameter name,
no longer makes the generator throwURIError: URI malformed. openapi-typescript read such a key
as a$ref; now it is one segment of the pointers the generator builds, so an--enum-values
array of such a key points at its own node. The exportedcreateRefkeeps the old behaviour. The
new enum names of such keys are listed under Major Changes.These pointers, and the ones in the generator's errors, escape
#as%23and%as%25
(RFC 6901), so a key likea#no longer cuts a pointer short. A discriminatormappingto a
schema whose name has a%, such as50%, no longer throwsURIErroreither. -
#49
e12bc23Thanks @fedorello! -silent: truein the Node API also hides the problem lines of a document that fails to load,
such asCan't resolve $ref; the rejectedSCHEMA_INVALIDerror lists them in
details.problems. openapi-typescript printed them to stderr even withsilent.
openapi-typesafe-react-query@1.0.0-rc.4
Patch Changes
-
#60
fc5608aThanks @fedorello! - The hooks name the helper types throughopenapi-typesafe-fetch, andopenapi-typesafe-helpers
is no longer a dependency. A library built withdeclaration: trueunder pnpm or Yarn PnP that
uses the hooks gets declarations that nameopenapi-typesafe-fetch, which it depends on: no TS2742
("cannot be named without a reference to …/openapi-typesafe-helpers") under pnpm, and no
import("openapi-typesafe-helpers")that its users cannot resolve under Yarn PnP.
openapi-react-query fails the same way. TanStack Query's own types keep two limits in a file that
does not import@tanstack/react-query: TS2742 under pnpm with TypeScript 5.4 (5.5 and later
work), andimport("@tanstack/query-core")under Yarn PnP; the react-query docs ("Libraries that
export hooks") give the fixes. -
#56
1b565d3Thanks @fedorello! - A library that exports a$api.queryOptions(...)result gets declarations that its users can
read: the taggedqueryKeyis typed with the exportedQueryKeyWithDataTag(TanStack Query's
type of that name, for every version of the peer range). The declarations spelled out TanStack's
[dataTagSymbol]keys without an import, so the library's users failed with TS2304, or gotany
fromqueryClient.getQueryData(options.queryKey)withskipLibCheck. -
Updated dependencies [
bc4d41d,1c8af0d,2afc816,cff72cd,bc4d41d,1c8af0d,cff72cd]:- openapi-typesafe-fetch@1.0.0-rc.4
openapi-typesafe-migrate@1.0.0-rc.4
No changes in this release.
openapi-typesafe-helpers@1.0.0-rc.4
Patch Changes
- #48
cff72cdThanks @fedorello! - A call with a union of paths (client.GET(path)withpath: "/a" | "/b") typesdataand
erroras the union of each operation's types. In openapi-fetch a path without a response body
typeddataas its content map, and a path with only adefaultresponse typed itundefined.
SuccessResponseandErrorResponseof a union of response maps are the union of each map's
responses. - Updated dependencies [
bc4d41d,1c8af0d,2afc816,cff72cd,bc4d41d,1c8af0d,cff72cd]:- openapi-typesafe-fetch@1.0.0-rc.4
openapi-typesafe-fetch@1.0.0-rc.4
Minor Changes
- #48
cff72cdThanks @fedorello! - The client declares the helper types (PathsWithMethod,FilterKeys,SuccessResponse, …) in
itsopenapi-typesafe-fetch/helpersentry, andopenapi-typesafe-helpersre-exports them. The
names of both packages are one declaration, so they mix, also in generic code:Readable<T>of one
package fitsReadable<T>of the other. A library built withdeclaration: trueunder pnpm or
Yarn PnP that uses the client gets declarations that nameopenapi-typesafe-fetch/helpers, of a
package it depends on, under everymoduleResolution(alsonode10): no TS2742 ("cannot be
named without a reference to …/openapi-typesafe-helpers") under pnpm, and noimport("openapi-typesafe-helpers")that its users
cannot resolve under Yarn PnP. openapi-fetch fails the same way. The main entry exports the names
of openapi-fetch and no helper type, soexport type * from "openapi-typesafe-fetch"next to a
type of the same name still compiles. The client no longer depends onopenapi-typesafe-helpers,
so it has no runtime dependency.
Patch Changes
-
#40
bc4d41dThanks @fedorello! - ADatein an exploded query array or object (the default styles) is sent as ISO 8601
(toISOString()); openapi-fetch threw "Deeply-nested arrays/objects aren't supported". ADate
field of amultipart/form-databody is sent as ISO 8601 too. The places where openapi-fetch left
aDateout or sent it as a local time text are listed under Major Changes. -
#47
1c8af0dThanks @fedorello! -randomID, exported at runtime as in openapi-fetch, is declared (randomID(): string) and listed
in the API docs, so TypeScript code can import it. -
#61
2afc816Thanks @fedorello! - AFormDatathatdefaultBodySerializerbuilt gets the platform's boundary also when another
copy of the package built it, such as the CommonJS build next to the ES module build in one
application. AbodySerializerthat wrapped the default one of the other build kept a boundary
set by hand, and the server could not split the parts. The form is marked with the registered
symbolSymbol.for("openapi-typesafe-fetch/form"), which is not a form field. -
#40
bc4d41dThanks @fedorello! - A success body that is not JSON, such as the HTML page of a proxy, throws aSyntaxErrorthat
names the status, theContent-Typeand the length of the body and says whichparseAsto set
(parseAs: "text"for atext/*response), instead of a bare parser error. The error holds no
body text, which can be a secret such as an OAuth token: the parser's error, whose message quotes
the body, is not kept ascauseeither. -
#47
1c8af0dThanks @fedorello! - AReadableStreambody, or an async iterable such as a Node.jsReadable
(fs.createReadStream()), is sent as a stream, with theduplex: "half"option that the Fetch
standard requires for it. It was JSON-encoded (to{}, or to the internal fields of aReadable)
with a JSONContent-Type, so a streamed upload was lost without an error.
The declarations name the async iterable type with/// <reference lib="es2018.asynciterable" />,
so a project whoselibis older than ES2018 still compiles. -
#48
cff72cdThanks @fedorello! - A call with a union of paths (client.GET(path)withpath: "/a" | "/b") typesdataand
erroras the union of each operation's types. In openapi-fetch a path without a response body
typeddataas its content map, and a path with only adefaultresponse typed itundefined.
SuccessResponseandErrorResponseof a union of response maps are the union of each map's
responses.
openapi-typesafe@1.0.0-rc.3
Patch Changes
-
#30
7650cd9Thanks @fedorello! - Every deprecation of something 2.0 removes is now a Node.jsDeprecationWarningwith an
OPENAPI_TYPESAFE_DEP_*code, shown once per process. The TypeScript-node forms oftransform,
postTransformandtransformPropertyused to print a warning line with the code
LEGACY_CALLBACK_DEPRECATEDthrough the generator's logger; they now emit
OPENAPI_TYPESAFE_DEP_TS_TRANSFORM,OPENAPI_TYPESAFE_DEP_TS_POST_TRANSFORMand
OPENAPI_TYPESAFE_DEP_TS_TRANSFORM_PROPERTY, asstringToAST()emits
OPENAPI_TYPESAFE_DEP_STRING_TO_AST.node --no-deprecationhides them,--throw-deprecation
makes them errors, andsilentno longer hides them. The newDEPRECATION_CODESexport lists the
codes;STRING_TO_AST_DEPRECATION_CODEand theLEGACY_CALLBACK_DEPRECATEDwarning code, which
only rc versions had, are removed. -
#30
7650cd9Thanks @fedorello! - The types generated for the OpenAPI 3.2 additions (queryoperations,additionalOperations,
itemSchema,in: querystring,components.mediaTypes) are experimental in 1.x: a minor release
may change their shape, for example to match openapi-typescript once it supports 3.2, and its
changelog says so. The output of documents without these keys,client.QUERY()and the"query"
member ofHttpMethodkeep the full semver promise. -
#30
7650cd9Thanks @fedorello! - The fix names are exported as theOutputFixunion, theOUTPUT_FIXESlist andOutputFixName
(a fix name or"all"), as ADR-021 describes. TheOutputFixobject (OutputFix.ALLOF_REQUIRED)
and theALL_OUTPUT_FIXESconstant, which only rc versions had, are removed: write the fix names
as strings, for examplefix: ["allof-required"]orfix: ["all"]. -
#29
a74808dThanks @fedorello! - The@redocly/openapi-corerange is^1.34.22again. In 1.0.0-rc.2 it was^1.34.23, which a
package manager with a minimum release age (for example bun'sminimum-release-ageof 7 days)
refused while that version was new.
openapi-typesafe@1.0.0-rc.2
Minor Changes
- #15
5837bacThanks @fedorello! - Every warning ends with a stable code (exported asWARNING_CODES); lint warnings name their
Redocly rule. New warnings, which change neither output nor exit code: a repeatedoperationId,
paths that differ only in parameter names, a discriminator value its member does not allow, an
unknownx-openapi-tskey, and an unknown CLI flag.
Patch Changes
-
#16
cd79dbdThanks @fedorello! - The type declarations keep their JSDoc, so editors show descriptions and mark deprecated exports. -
#15
5837bacThanks @fedorello! - The declarations type-check with TypeScript 7 andskipLibCheck: false. -
#23
54c59f2Thanks @fedorello! - The deprecatedresolveReftakes the document asunknowninstead ofany, so any value is still
accepted. It now returns the node when a$refthat is not a string is found, instead of failing.
openapi-typesafe-react-query@1.0.0-rc.3
Patch Changes
- Updated dependencies []:
- openapi-typesafe-fetch@1.0.0-rc.3
- openapi-typesafe-helpers@1.0.0-rc.3
openapi-typesafe-react-query@1.0.0-rc.2
Major Changes
-
#18
bfd3e60Thanks @fedorello! - First stable release of openapi-typesafe-react-query, the successor of openapi-react-query 0.5.4.
Its peer dependency is nowopenapi-typesafe-fetchinstead ofopenapi-fetch, next to
@tanstack/react-query5.80 or newer. From 1.0 the package follows semver.Changes that can need work when you move from openapi-react-query 0.5.4:
engines.nodeis>=22.- Queries and mutations fail on every non-OK response, also one without a body or with a falsy
body such as0(upstream #2070, #2531). useInfiniteQueryhas its own key,[...queryKey, "infinite"], so it no longer shares a cache
entry withuseQuery(upstream #2184). Prefix matches still work; code that uses the exact
key must append"infinite".- An
undefinedpage param is left out of the request; it was sent as0(upstream #2715,
#2340).
Patch Changes
openapi-typesafe-migrate@1.0.0-rc.3
No changes in this release.