Skip to content

Releases: drwpow/openapi-typescript

openapi-fetch@0.9.7

19 May 19:22
24eca72
Compare
Choose a tag to compare

Patch Changes

  • #1672 64cb619 Thanks @jaredLunde! - Fixes issue where native properties were not excluded from custom properties in the CustomRequest class

openapi-typescript@7.0.0-rc.0

19 May 19:01
bda737c
Compare
Choose a tag to compare
Pre-release

openapi-typescript

7.0.0

Major Changes

  • 6d1eb32 Thanks @drwpow! - โš ๏ธ Breaking: The Node.js API now returns the TypeScript AST for the main method as well as transform() and postTransform(). To migrate, youโ€™ll have to use the typescript compiler API:

    + import ts from "typescript";
    
    + const DATE = ts.factory.createIdentifier("Date");
    + const NULL = ts.factory.createLiteralTypeNode(ts.factory.createNull());
    
      const ast = await openapiTS(mySchema, {
        transform(schemaObject, metadata) {
          if (schemaObject.format === "date-time") {
    -       return schemaObject.nullable ? "Date | null" : "Date";
    +       return schemaObject.nullable
    +         ? ts.factory.createUnionTypeNode([DATE, NULL])
    +         : DATE;
          }
        },
      };

    Though itโ€™s more verbose, itโ€™s also more powerful, as now you have access to additional properties of the generated code you didnโ€™t before (such as injecting comments).

    For example syntax, search this codebae to see how the TypeScript AST is used.

    Also see AST Explorerโ€™s typescript parser to inspect how TypeScript is interpreted as an AST.

  • 6d1eb32 Thanks @drwpow! - โš ๏ธ Breaking: Changing of several CLI flags and Node.js API options

    • The --auth, --httpHeaders, --httpMethod, and fetch (Node.js-only) options were all removed from the CLI and Node.js API
    • --immutable-types has been renamed to --immutable
    • --support-array-length has been renamed to --array-length
  • fbaf96d Thanks @drwpow! - โš ๏ธ Breaking: Remove globbing schemas in favor of redocly.yaml config. Specify multiple schemas with outputs in there instead. See Multiple schemas for more info.

  • 6d1eb32 Thanks @drwpow! - โš ๏ธ Breaking: Most optional objects are now always present in types, just typed as :never. This includes keys of the Components Object as well as HTTP methods.

  • 6d1eb32 Thanks @drwpow! - โš ๏ธ Breaking: No more external export in schemas anymore. Everything gets flattened into the components object instead (if referencing a schema object from a remote partial, note it may have had a minor name change to avoid conflict).

  • 6d1eb32 Thanks @drwpow! - โš ๏ธ Breaking defaultNonNullable option now defaults to true. Youโ€™ll now need to manually set false to return to old behavior.

  • 799194d Thanks @drwpow~ - โš ๏ธ Breaking TypeScript is now a peerDependency and must be installed alongside openapi-typescript

Minor Changes

  • 6d1eb32 Thanks @drwpow! - โœจ Feature: automatically validate schemas with Redocly CLI (docs). No more need for external tools to report errors! ๐ŸŽ‰

    • By default, it will only throw on actual schema errors (uses Redoclyโ€™s default settings)
    • For stricter linting or custom rules, you can create a redocly.yaml config
  • 312b7ba Thanks @drwpow! - โœจ Feature: allow configuration of schemas via apis key in redocly.config.yaml. See docs for more info.

  • 6d1eb32 Thanks @drwpow! - โœจ Feature: add enum option to export top-level enums from schemas

  • 6d1eb32 Thanks @drwpow! - โœจ Feature: add formatOptions to allow formatting TS output

  • 6d1eb32 Thanks @drwpow! - โœจ Feature: header responses add [key: string]: unknown index type to allow for additional untyped headers

  • 6d1eb32 Thanks @drwpow! - โœจ Feature: bundle schemas with Redocly CLI

  • 6d1eb32 Thanks @drwpow! - โœจ Feature: Added debugger that lets you profile performance and see more in-depth messages

  • #1374 7ac5174 Thanks @ElForastero! - Add support for x-enum-varnames and x-enum-descriptions

  • #1545 9158b81 Thanks @jaredLunde! - Replace # characters in operation IDs with a slash

Patch Changes

  • 6d1eb32 Thanks @drwpow! - Refactor internals to use TypeScript AST rather than string mashing

  • 6d1eb32 Thanks @drwpow! - ๐Ÿงน Cleaned up and reorganized all tests

  • #1602 9da96cd Thanks @JeanRemiDelteil! - Do not add readonly on Typescript enum when the --immutable option is used.

6.7.0

Minor Changes

6.6.2

Patch Changes

6.6.1

Patch Changes

6.6.0

Minor Changes

6.5.5

Patch Changes

6.5.4

Patch Changes

  • #1324 0357325 Thanks @drwpow! - Fix accidental quote appearing in components/responses with $refs

6.5.3

Patch Changes

Read more

openapi-fetch@0.9.6

16 May 17:08
a7dbe90
Compare
Choose a tag to compare

Patch Changes

openapi-fetch@0.9.5

28 Apr 22:57
7e3df85
Compare
Choose a tag to compare

Patch Changes

openapi-fetch@0.9.4

23 Apr 19:02
Compare
Choose a tag to compare

Patch Changes

openapi-typescript@6.7.5

12 Mar 20:16
Compare
Choose a tag to compare

Patch Changes

openapi-fetch@0.9.3

06 Mar 05:08
b0d2bb2
Compare
Choose a tag to compare

Patch Changes

openapi-fetch@0.9.2

19 Feb 01:48
8aab256
Compare
Choose a tag to compare

Patch Changes

  • #1550 a5a9cc7 Thanks @shirish87! - Fix 'Content-Type' header being removed from requests with multipart/form-data body

openapi-fetch@0.9.1

16 Feb 03:41
484ceb9
Compare
Choose a tag to compare

Patch Changes

openapi-typescript-helpers@0.0.7

15 Feb 18:15
Compare
Choose a tag to compare

Patch Changes

  • #1479 c6d945b Thanks @darwish! - Fixed build of openapi-typescript-helpers for CommonJS environments