Skip to content

Releases

openapi-typesafe@1.0.0-rc.4

Pre-release

Choose a tag to compare

@github-actions github-actions released this 09 Nov 20:05
Immutable release. Only release title and notes can be modified.
50d293c

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 e12bc23 Thanks @fedorello! - An --output or x-openapi-ts.output that cannot be a file fails with the new error code
    CLI_OUTPUT_INVALID (exit code 2) 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 with EISDIR or 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 a4a1104 Thanks @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 code 2. openapi-typescript checked neither:

    • An --output, or an x-openapi-ts.output in redocly.yaml, that names a file the CLI
      reads fails with the new error code CLI_OUTPUT_IS_INPUT: the schema, a local file one of
      its $refs loads, or redocly.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.yaml whose 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é.ts in NFC and NFD, straße.ts and STRASSE.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.
  • #50 90e2668 Thanks @fedorello! - Remote documents have size limits. The loader reads each body as a stream and counts the bytes
    after gzip, deflate or br is decoded, so a compressed "zip bomb" behind a remote $ref no
    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 with SCHEMA_REF_FORBIDDEN and
    the new reasons remote-document-too-large and remote-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 reason remote-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. A customFetch in the
    Redocly config is limited too.

Patch Changes

  • #53 5e1d76a Thanks @fedorello! - A key that contains #/, such as a path /items/#/%zz, a property a#/b or a parameter name,
    no longer makes the generator throw URIError: 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 exported createRef keeps 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 %23 and % as %25
    (RFC 6901), so a key like a# no longer cuts a pointer short. A discriminator mapping to a
    schema whose name has a %, such as 50%, no longer throws URIError either.

  • #49 e12bc23 Thanks @fedorello! - silent: true in the Node API also hides the problem lines of a document that fails to load,
    such as Can't resolve $ref; the rejected SCHEMA_INVALID error lists them in
    details.problems. openapi-typescript printed them to stderr even with silent.

openapi-typesafe-react-query@1.0.0-rc.4

Pre-release

Choose a tag to compare

@github-actions github-actions released this 09 Nov 20:06
Immutable release. Only release title and notes can be modified.
50d293c

Patch Changes

  • #60 fc5608a Thanks @fedorello! - The hooks name the helper types through openapi-typesafe-fetch, and openapi-typesafe-helpers
    is no longer a dependency. A library built with declaration: true under pnpm or Yarn PnP that
    uses the hooks gets declarations that name openapi-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), and import("@tanstack/query-core") under Yarn PnP; the react-query docs ("Libraries that
    export hooks") give the fixes.

  • #56 1b565d3 Thanks @fedorello! - A library that exports a $api.queryOptions(...) result gets declarations that its users can
    read: the tagged queryKey is typed with the exported QueryKeyWithDataTag (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 got any
    from queryClient.getQueryData(options.queryKey) with skipLibCheck.

  • 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

Pre-release

Choose a tag to compare

@github-actions github-actions released this 09 Nov 20:05
Immutable release. Only release title and notes can be modified.
50d293c

No changes in this release.

openapi-typesafe-helpers@1.0.0-rc.4

Pre-release

Choose a tag to compare

@github-actions github-actions released this 09 Nov 20:06
Immutable release. Only release title and notes can be modified.
50d293c

Patch Changes

  • #48 cff72cd Thanks @fedorello! - A call with a union of paths (client.GET(path) with path: "/a" | "/b") types data and
    error as the union of each operation's types. In openapi-fetch a path without a response body
    typed data as its content map, and a path with only a default response typed it undefined.
    SuccessResponse and ErrorResponse of 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

Pre-release

Choose a tag to compare

@github-actions github-actions released this 09 Nov 20:05
Immutable release. Only release title and notes can be modified.
50d293c

Minor Changes

  • #48 cff72cd Thanks @fedorello! - The client declares the helper types (PathsWithMethod, FilterKeys, SuccessResponse, …) in
    its openapi-typesafe-fetch/helpers entry, and openapi-typesafe-helpers re-exports them. The
    names of both packages are one declaration, so they mix, also in generic code: Readable<T> of one
    package fits Readable<T> of the other. A library built with declaration: true under pnpm or
    Yarn PnP that uses the client gets declarations that name openapi-typesafe-fetch/helpers, of a
    package it depends on, under every moduleResolution (also node10): 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-fetch fails the same way. The main entry exports the names
    of openapi-fetch and no helper type, so export type * from "openapi-typesafe-fetch" next to a
    type of the same name still compiles. The client no longer depends on openapi-typesafe-helpers,
    so it has no runtime dependency.

Patch Changes

  • #40 bc4d41d Thanks @fedorello! - A Date in 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". A Date
    field of a multipart/form-data body is sent as ISO 8601 too. The places where openapi-fetch left
    a Date out or sent it as a local time text are listed under Major Changes.

  • #47 1c8af0d Thanks @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 2afc816 Thanks @fedorello! - A FormData that defaultBodySerializer built 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. A bodySerializer that 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
    symbol Symbol.for("openapi-typesafe-fetch/form"), which is not a form field.

  • #40 bc4d41d Thanks @fedorello! - A success body that is not JSON, such as the HTML page of a proxy, throws a SyntaxError that
    names the status, the Content-Type and the length of the body and says which parseAs to set
    (parseAs: "text" for a text/* 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 as cause either.

  • #47 1c8af0d Thanks @fedorello! - A ReadableStream body, or an async iterable such as a Node.js Readable
    (fs.createReadStream()), is sent as a stream, with the duplex: "half" option that the Fetch
    standard requires for it. It was JSON-encoded (to {}, or to the internal fields of a Readable)
    with a JSON Content-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 whose lib is older than ES2018 still compiles.

  • #48 cff72cd Thanks @fedorello! - A call with a union of paths (client.GET(path) with path: "/a" | "/b") types data and
    error as the union of each operation's types. In openapi-fetch a path without a response body
    typed data as its content map, and a path with only a default response typed it undefined.
    SuccessResponse and ErrorResponse of a union of response maps are the union of each map's
    responses.

openapi-typesafe@1.0.0-rc.3

Pre-release

Choose a tag to compare

@github-actions github-actions released this 08 Nov 15:51
Immutable release. Only release title and notes can be modified.
520c520

Patch Changes

  • #30 7650cd9 Thanks @fedorello! - Every deprecation of something 2.0 removes is now a Node.js DeprecationWarning with an
    OPENAPI_TYPESAFE_DEP_* code, shown once per process. The TypeScript-node forms of transform,
    postTransform and transformProperty used to print a warning line with the code
    LEGACY_CALLBACK_DEPRECATED through the generator's logger; they now emit
    OPENAPI_TYPESAFE_DEP_TS_TRANSFORM, OPENAPI_TYPESAFE_DEP_TS_POST_TRANSFORM and
    OPENAPI_TYPESAFE_DEP_TS_TRANSFORM_PROPERTY, as stringToAST() emits
    OPENAPI_TYPESAFE_DEP_STRING_TO_AST. node --no-deprecation hides them, --throw-deprecation
    makes them errors, and silent no longer hides them. The new DEPRECATION_CODES export lists the
    codes; STRING_TO_AST_DEPRECATION_CODE and the LEGACY_CALLBACK_DEPRECATED warning code, which
    only rc versions had, are removed.

  • #30 7650cd9 Thanks @fedorello! - The types generated for the OpenAPI 3.2 additions (query operations, 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 of HttpMethod keep the full semver promise.

  • #30 7650cd9 Thanks @fedorello! - The fix names are exported as the OutputFix union, the OUTPUT_FIXES list and OutputFixName
    (a fix name or "all"), as ADR-021 describes. The OutputFix object (OutputFix.ALLOF_REQUIRED)
    and the ALL_OUTPUT_FIXES constant, which only rc versions had, are removed: write the fix names
    as strings, for example fix: ["allof-required"] or fix: ["all"].

  • #29 a74808d Thanks @fedorello! - The @redocly/openapi-core range is ^1.34.22 again. In 1.0.0-rc.2 it was ^1.34.23, which a
    package manager with a minimum release age (for example bun's minimum-release-age of 7 days)
    refused while that version was new.

openapi-typesafe@1.0.0-rc.2

Pre-release

Choose a tag to compare

@github-actions github-actions released this 08 Nov 12:34
Immutable release. Only release title and notes can be modified.
48d4ac9

Minor Changes

  • #15 5837bac Thanks @fedorello! - Every warning ends with a stable code (exported as WARNING_CODES); lint warnings name their
    Redocly rule. New warnings, which change neither output nor exit code: a repeated operationId,
    paths that differ only in parameter names, a discriminator value its member does not allow, an
    unknown x-openapi-ts key, and an unknown CLI flag.

Patch Changes

  • #16 cd79dbd Thanks @fedorello! - The type declarations keep their JSDoc, so editors show descriptions and mark deprecated exports.

  • #15 5837bac Thanks @fedorello! - The declarations type-check with TypeScript 7 and skipLibCheck: false.

  • #23 54c59f2 Thanks @fedorello! - The deprecated resolveRef takes the document as unknown instead of any, so any value is still
    accepted. It now returns the node when a $ref that is not a string is found, instead of failing.

openapi-typesafe-react-query@1.0.0-rc.3

Pre-release

Choose a tag to compare

@github-actions github-actions released this 08 Nov 15:51
Immutable release. Only release title and notes can be modified.
520c520

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

Pre-release

Choose a tag to compare

@github-actions github-actions released this 08 Nov 12:34
Immutable release. Only release title and notes can be modified.
48d4ac9

Major Changes

  • #18 bfd3e60 Thanks @fedorello! - First stable release of openapi-typesafe-react-query, the successor of openapi-react-query 0.5.4.
    Its peer dependency is now openapi-typesafe-fetch instead of openapi-fetch, next to
    @tanstack/react-query 5.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.node is >=22.
    • Queries and mutations fail on every non-OK response, also one without a body or with a falsy
      body such as 0 (upstream #2070, #2531).
    • useInfiniteQuery has its own key, [...queryKey, "infinite"], so it no longer shares a cache
      entry with useQuery (upstream #2184). Prefix matches still work; code that uses the exact
      key must append "infinite".
    • An undefined page param is left out of the request; it was sent as 0 (upstream #2715,
      #2340).

Patch Changes

openapi-typesafe-migrate@1.0.0-rc.3

Pre-release

Choose a tag to compare

@github-actions github-actions released this 08 Nov 15:51
Immutable release. Only release title and notes can be modified.
520c520

No changes in this release.