Skip to content

Commit 2608cf1

Browse files
authored
Merge pull request #2246 from hey-api/feat/typescript-config
Add `parser` options πŸ‘¨β€πŸ”§
2 parents 7884190 + a11a8c5 commit 2608cf1

File tree

322 files changed

+28381
-10063
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

322 files changed

+28381
-10063
lines changed

β€Ž.changeset/dull-experts-retire.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@hey-api/openapi-ts': patch
3+
---
4+
5+
fix(config): add `operations` option to `parser.patch`

β€Ž.changeset/dull-tomatoes-smell.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@hey-api/openapi-ts': minor
3+
---
4+
5+
feat(typescript): move `enumsCase` option to `enums.case`

β€Ž.changeset/few-olives-rest.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@hey-api/openapi-ts': minor
3+
---
4+
5+
fix(config): move `input.pagination` option to `parser.pagination`

β€Ž.changeset/gentle-adults-speak.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@hey-api/openapi-ts': minor
3+
---
4+
5+
feat(typescript): move `readOnlyWriteOnlyBehavior` option to `parser.transforms.readWrite.enabled`

β€Ž.changeset/gentle-sloths-beam.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@hey-api/openapi-ts': minor
3+
---
4+
5+
fix(config): move `input.validate_EXPERIMENTAL` option to `parser.validate_EXPERIMENTAL`

β€Ž.changeset/khaki-ducks-double.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@hey-api/openapi-ts': minor
3+
---
4+
5+
feat(typescript): move `readableNameBuilder` option to `parser.transforms.readWrite.responses.name`

β€Ž.changeset/nervous-cameras-poke.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@hey-api/openapi-ts': minor
3+
---
4+
5+
fix(config): move `input.patch` option to `parser.patch`

β€Ž.changeset/silver-seals-teach.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@hey-api/openapi-ts': minor
3+
---
4+
5+
feat(typescript): move `enumsConstantsIgnoreNull` option to `enums.constantsIgnoreNull`

β€Ž.changeset/sour-dancers-draw.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
'@hey-api/openapi-ts': minor
3+
---
4+
5+
feat(config): add `parser` options
6+
7+
### Added `parser` options
8+
9+
Previously, `@hey-api/typescript` would generate correct types, but the validator plugins would have to re-implement the same logic or generate schemas that didn't match the generated types.
10+
11+
Since neither option was ideal, this release adds a dedicated place for `parser` options. Parser is responsible for preparing the input so plugins can generate more accurate output with less effort.
12+
13+
You can learn more about configuring parser on the [Parser](https://heyapi.dev/openapi-ts/configuration/parser) page.
14+
15+
### Moved `input` options
16+
17+
The following options were moved to the new `parser` group.
18+
19+
- `input.filters` moved to `parser.filters`
20+
- `input.pagination` moved to `parser.pagination`
21+
- `input.patch` moved to `parser.patch`
22+
- `input.validate_EXPERIMENTAL` moved to `parser.validate_EXPERIMENTAL`
23+
24+
### Updated `typescript` options
25+
26+
The following options were renamed.
27+
28+
- `enumsCase` moved to `enums.case`
29+
- `enumsConstantsIgnoreNull` moved to `enums.constantsIgnoreNull`
30+
31+
### Moved `typescript` options
32+
33+
The following options were moved to the new `parser` group.
34+
35+
- `exportInlineEnums` moved to `parser.transforms.enums`
36+
- `readOnlyWriteOnlyBehavior` moved to `parser.transforms.readWrite.enabled`
37+
- `readableNameBuilder` moved to `parser.transforms.readWrite.responses.name`
38+
- `writableNameBuilder` moved to `parser.transforms.readWrite.requests.name`
39+
40+
### Updated `readWrite.responses` name
41+
42+
Additionally, the naming pattern for response schemas has changed from `{name}Readable` to `{name}`. This is to prevent your code from breaking by default when using a schema that gets updated with a write-only field.

β€Ž.changeset/sweet-ears-flash.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@hey-api/openapi-ts': minor
3+
---
4+
5+
feat(typescript): move `exportInlineEnums` option to `parser.transforms.enums`

0 commit comments

Comments
Β (0)