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
--default-headers <comma_separated_names_of_headers> header names so that the generated client includes the default HTTP headers across all endpoints (default: "")
38
+
-h, --help display help for command
39
+
```
37
40
38
-
## Example
41
+
###Example
39
42
40
-
Please refer the [examples](./examples/).
43
+
Please refer to the [examples](./examples/).
41
44
42
45
`schema.d.ts` is generated from `schema.yaml` by `openapi-typescript`, and `generated_client.ts` is generated by this tool according to the `schema.d.ts`.
43
46
44
-
FYI, the client user would be able to use it as like the following:
47
+
FYI, you can use the generated client as follows:
45
48
46
49
```typescript
47
50
import { Client } from"./generated_client";
@@ -62,6 +65,133 @@ async function doSomething() {
62
65
}
63
66
```
64
67
68
+
### Default HTTP Headers
69
+
70
+
This tool provides a `--default-headers` CLI option to configure the generated client to use default HTTP headers.
If your default headers cover **all** required headers for the endpoint (e.g. `--default-headers'Authorization, Application-Version, Something-Id'`), you can omit the `header` parameter entirely:
0 commit comments