Skip to content

Commit ebb73b6

Browse files
authored
Fix bugs with remote $refs, add cwd option for JSON schema parsing (#1308)
1 parent 17bc87e commit ebb73b6

20 files changed

+13787
-4594
lines changed

.changeset/silly-maps-rush.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"openapi-typescript": patch
3+
---
4+
5+
Fix bugs with remote $refs, add `cwd` option for JSON schema parsing

docs/src/content/docs/node.md

+7-6
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,13 @@ const output = await openapiTS("https://myurl.com/v1/openapi.yaml");
4343
4444
The Node API supports all the [CLI flags](/cli#options) in `camelCase` format, plus the following additional options:
4545
46-
| Name | Type | Default | Description |
47-
| :-------------- | :--------: | :------ | :------------------------------------------------------------------------------- |
48-
| `commentHeader` | `string` | | Override the default “This file was auto-generated …” file heading |
49-
| `inject` | `string` | | Inject arbitrary TypeScript types into the start of the file |
50-
| `transform` | `Function` | | Override the default Schema Object ➝ TypeScript transformer in certain scenarios |
51-
| `postTransform` | `Function` | | Same as `transform` but runs _after_ the TypeScript transformation |
46+
| Name | Type | Default | Description |
47+
| :-------------- | :-------------: | :------ | :------------------------------------------------------------------------------------------------------------------- |
48+
| `commentHeader` | `string` | | Override the default “This file was auto-generated …” file heading |
49+
| `inject` | `string` | | Inject arbitrary TypeScript types into the start of the file |
50+
| `transform` | `Function` | | Override the default Schema Object ➝ TypeScript transformer in certain scenarios |
51+
| `postTransform` | `Function` | | Same as `transform` but runs _after_ the TypeScript transformation |
52+
| `cwd` | `string \| URL` | | (optional) Provide the current working directory to resolve remote `$ref`s (only needed for in-memory JSON objects). |
5253
5354
### transform / postTransform
5455

0 commit comments

Comments
 (0)