Skip to content

Commit 239b6f4

Browse files
committed
Bump version
1 parent bfecc71 commit 239b6f4

16 files changed

+73
-110
lines changed

.changeset/beige-students-wink.md

-5
This file was deleted.

.changeset/blue-ladybugs-laugh.md

-5
This file was deleted.

.changeset/giant-scissors-repeat.md

-5
This file was deleted.

.changeset/happy-lamps-bathe.md

-5
This file was deleted.

.changeset/lazy-ads-add.md

-5
This file was deleted.

.changeset/modern-bobcats-think.md

-5
This file was deleted.

.changeset/nasty-candles-rescue.md

-5
This file was deleted.

.changeset/rude-jokes-grin.md

-11
This file was deleted.

.changeset/shaggy-adults-obey.md

-5
This file was deleted.

.changeset/shaggy-experts-confess.md

-7
This file was deleted.

.changeset/shaggy-windows-worry.md

-5
This file was deleted.

.changeset/short-llamas-listen.md

-5
This file was deleted.

.changeset/thirty-turkeys-leave.md

-5
This file was deleted.

.changeset/warm-masks-decide.md

-8
This file was deleted.

.changeset/wise-coins-hug.md

-29
This file was deleted.

packages/openapi-typescript/CHANGELOG.md

+73
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,78 @@
11
# openapi-typescript
22

3+
## 7.0.0
4+
5+
### Major Changes
6+
7+
- [`6d1eb32`](https://github.com/drwpow/openapi-typescript/commit/6d1eb32e610cb62effbd1a817ae8fc93337126a6) Thanks [@drwpow](https://github.com/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.
8+
9+
- [`6d1eb32`](https://github.com/drwpow/openapi-typescript/commit/6d1eb32e610cb62effbd1a817ae8fc93337126a6) Thanks [@drwpow](https://github.com/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).
10+
11+
- [`6d1eb32`](https://github.com/drwpow/openapi-typescript/commit/6d1eb32e610cb62effbd1a817ae8fc93337126a6) Thanks [@drwpow](https://github.com/drwpow)! - ⚠️ **Breaking**: Changing of several CLI flags and Node.js API options
12+
13+
- The `--auth`, `--httpHeaders`, `--httpMethod`, and `fetch` (Node.js-only) options were all removed from the CLI and Node.js API
14+
- To migrate, you’ll need to create a [redocly.yaml config](https://redocly.com/docs/cli/configuration/) that specifies your auth options [in the http setting](https://redocly.com/docs/cli/configuration/#resolve-non-public-or-non-remote-urls)
15+
- You can also set your fetch client in redocly.yaml as well.
16+
- `--immutable-types` has been renamed to `--immutable`
17+
- `--support-array-length` has been renamed to `--array-length`
18+
19+
- [`6d1eb32`](https://github.com/drwpow/openapi-typescript/commit/6d1eb32e610cb62effbd1a817ae8fc93337126a6) Thanks [@drwpow](https://github.com/drwpow)! - ⚠️ **Breaking** `defaultNonNullable` option now defaults to `true`. You’ll now need to manually set `false` to return to old behavior.
20+
21+
- [`fbaf96d`](https://github.com/drwpow/openapi-typescript/commit/fbaf96d33181a2fabd3d4748e54c0f111ed6756e) Thanks [@drwpow](https://github.com/drwpow)! - ⚠️ **Breaking**: Remove globbing schemas in favor of `redocly.yaml` config. Specify multiple schemas with outputs in there instead. See [Multiple schemas](https://openapi-ts.pages.dev/docs/cli/#multiple-schemas) for more info.
22+
23+
- [`6d1eb32`](https://github.com/drwpow/openapi-typescript/commit/6d1eb32e610cb62effbd1a817ae8fc93337126a6) Thanks [@drwpow](https://github.com/drwpow)! - ⚠️ **Breaking**: additionalProperties no longer have `| undefined` automatically appended
24+
25+
- [`6d1eb32`](https://github.com/drwpow/openapi-typescript/commit/6d1eb32e610cb62effbd1a817ae8fc93337126a6) Thanks [@drwpow](https://github.com/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:
26+
27+
```diff
28+
+ import ts from "typescript";
29+
30+
+ const DATE = ts.factory.createIdentifier("Date");
31+
+ const NULL = ts.factory.createLiteralTypeNode(ts.factory.createNull());
32+
33+
const ast = await openapiTS(mySchema, {
34+
transform(schemaObject, metadata) {
35+
if (schemaObject.format === "date-time") {
36+
- return schemaObject.nullable ? "Date | null" : "Date";
37+
+ return schemaObject.nullable
38+
+ ? ts.factory.createUnionTypeNode([DATE, NULL])
39+
+ : DATE;
40+
}
41+
},
42+
};
43+
```
44+
45+
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).
46+
47+
For example syntax, search this codebae to see how the TypeScript AST is used.
48+
49+
Also see [AST Explorer](https://astexplorer.net/)’s `typescript` parser to inspect how TypeScript is interpreted as an AST.
50+
51+
### Minor Changes
52+
53+
- [`6d1eb32`](https://github.com/drwpow/openapi-typescript/commit/6d1eb32e610cb62effbd1a817ae8fc93337126a6) Thanks [@drwpow](https://github.com/drwpow)! - ✨ **Feature**: add `formatOptions` to allow formatting TS output
54+
55+
- [`6d1eb32`](https://github.com/drwpow/openapi-typescript/commit/6d1eb32e610cb62effbd1a817ae8fc93337126a6) Thanks [@drwpow](https://github.com/drwpow)! - ✨ **Feature**: add `enum` option to export top-level enums from schemas
56+
57+
- [`6d1eb32`](https://github.com/drwpow/openapi-typescript/commit/6d1eb32e610cb62effbd1a817ae8fc93337126a6) Thanks [@drwpow](https://github.com/drwpow)! - ✨ **Feature**: header responses add `[key: string]: unknown` index type to allow for additional untyped headers
58+
59+
- [`6d1eb32`](https://github.com/drwpow/openapi-typescript/commit/6d1eb32e610cb62effbd1a817ae8fc93337126a6) Thanks [@drwpow](https://github.com/drwpow)! - ✨ **Feature**: bundle schemas with Redocly CLI
60+
61+
- Any options passed into your [redocly.yaml config](https://redocly.com/docs/cli/configuration/) are respected
62+
63+
- [`312b7ba`](https://github.com/drwpow/openapi-typescript/commit/312b7ba03fc0334153d4eeb51d6159f3fc63934e) Thanks [@drwpow](https://github.com/drwpow)! - ✨ **Feature:** allow configuration of schemas via `apis` key in redocly.config.yaml. [See docs](https://openapi-ts.pages.dev/cli/) for more info.
64+
65+
- [`6d1eb32`](https://github.com/drwpow/openapi-typescript/commit/6d1eb32e610cb62effbd1a817ae8fc93337126a6) Thanks [@drwpow](https://github.com/drwpow)! - ✨ **Feature**: automatically validate schemas with Redocly CLI ([docs](https://redocly.com/docs/cli/)). No more need for external tools to report errors! 🎉
66+
67+
- By default, it will only throw on actual schema errors (uses Redocly’s default settings)
68+
- For stricter linting or custom rules, you can create a [redocly.yaml config](https://redocly.com/docs/cli/configuration/)
69+
70+
### Patch Changes
71+
72+
- [`6d1eb32`](https://github.com/drwpow/openapi-typescript/commit/6d1eb32e610cb62effbd1a817ae8fc93337126a6) Thanks [@drwpow](https://github.com/drwpow)! - 🧹 Cleaned up and reorganized all tests
73+
74+
- [`6d1eb32`](https://github.com/drwpow/openapi-typescript/commit/6d1eb32e610cb62effbd1a817ae8fc93337126a6) Thanks [@drwpow](https://github.com/drwpow)! - Refactor internals to use TypeScript AST rather than string mashing
75+
376
## 6.7.0
477

578
### Minor Changes

0 commit comments

Comments
 (0)