Skip to content

Commit a11a8c5

Browse files
committed
docs: add parser documentation
1 parent e47f3cc commit a11a8c5

File tree

20 files changed

+993
-540
lines changed

20 files changed

+993
-540
lines changed

.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.

docs/.vitepress/config/en.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,21 @@ export default defineConfig({
2222
text: 'Get Started',
2323
},
2424
{
25+
collapsed: true,
26+
items: [
27+
{
28+
link: '/openapi-ts/configuration/input',
29+
text: 'Input',
30+
},
31+
{
32+
link: '/openapi-ts/configuration/output',
33+
text: 'Output',
34+
},
35+
{
36+
link: '/openapi-ts/configuration/parser',
37+
text: 'Parser',
38+
},
39+
],
2540
link: '/openapi-ts/configuration',
2641
text: 'Configuration',
2742
},

docs/.vitepress/theme/Layout.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const { Layout } = DefaultTheme;
88
<Layout>
99
<template #layout-top>
1010
<div class="announcement">
11-
<span> Build better APIs with our platform </span>
11+
<span> Build better APIs with Hey API Platform </span>
1212
<a
1313
href="https://app.heyapi.dev/"
1414
rel="noopener noreferrer"

0 commit comments

Comments
 (0)