You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/content/docs/introduction.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ _Note: OpenAPI 2.x is supported with versions `5.x` and previous_
27
27
This library requires the latest version of <ahref="https://nodejs.org/en"target="_blank"rel="noopener noreferrer">Node.js</a> installed (20.x or higher recommended). With that present, run the following in your project:
28
28
29
29
```bash
30
-
npm i -D openapi-typescript
30
+
npm i -D openapi-typescript@next
31
31
```
32
32
33
33
> **Highly recommended**: enable [noUncheckedIndexedAccess](https://www.typescriptlang.org/tsconfig#noUncheckedIndexedAccess) in your `tsconfig.json` ([docs](/advanced#enable-nouncheckedindexaccess-in-your-tsconfigjson))
description: Migrating between openapi-typescript versions
4
+
---
5
+
6
+
## v6 → v7
7
+
8
+
The v7 release only has a few minor breaking changes to be aware of:
9
+
10
+
### TypeScript AST
11
+
12
+
v7 introduces the TypeScript AST rather than simple string transformations. This applies to the core Node.js API, which now returns a TypeScript AST, as well as the options `transform()` and `postTransform()`. [The Node.js API docs have been updated with relevant examples to help](./node).
13
+
14
+
### Globbing replaced with Redocly config
15
+
16
+
v7 can still generate multiple schemas at once, but rather than globbing, a `redocly.config.yaml` file must be created instead that lists out every input schema, and where the output types should be saved. [See the updated docs for more info](./cli#redoc-config).
17
+
18
+
### Node.js API input types
19
+
20
+
Input types were made more predictable in v7. Inputting a partial filepath as a string was removed because it was somewhat nondeterministic—it would either succeed or fail based on where the Node.js API was called from. Now, to load a schema from a filepath or remote URL, use a proper `URL` like so:
_Note: `import.meta.url` is only needed for local files; you can simply point to a URL for remote schemas_
28
+
29
+
This is more predictable, and works in more environments.
30
+
31
+
In addition, the `string` input is now more robust. v6 didn’t support inputting a full YAML spec as a string, but v7 can handle a dynamic YAML and/or JSON string just fine (JSON in object form is still accepted, too).
32
+
33
+
[See the updated docs for more info](./node#usage).
34
+
35
+
[See the full CHANGELOG](https://github.com/drwpow/openapi-typescript/blob/6.x/packages/openapi-typescript/CHANGELOG.md)
Copy file name to clipboardExpand all lines: docs/src/content/docs/node.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ The Node API may be useful if dealing with dynamically-created schemas, or you
8
8
## Setup
9
9
10
10
```bash
11
-
npm i --save-dev openapi-typescript
11
+
npm i --save-dev openapi-typescript@next
12
12
```
13
13
14
14
> **Recommended**: For the best experience, use Node ESM by adding `"type": "module"` to `package.json` ([docs](https://nodejs.org/api/esm.html#enabling))
0 commit comments