Output
Learn about files generated with @hey-api/openapi-ts
.
TIP
Your actual output depends on your Hey API configuration. It may contain a different number of files and their contents might differ.
Overview
If you use the default configuration, your project might look like this.
my-app/
├── node_modules/
├── src/
│ ├── client/
│ │ ├── index.ts
│ │ ├── sdk.gen.ts
│ │ └── types.gen.ts
│ └── index.ts
└── package.json
Each file is an artifact generated by a Hey API plugin. This is the default output, we will cover customizing it in this section. These files also form the base for third-party plugins.
Let's go through each file in the src/client
folder and explain what it looks like, what it does, and how to use it.
Index
For convenience, every artifact generated by default plugins is re-exported from index.ts
. However, we recommend importing artifacts from their files to avoid ambiguity.
import type { Pet } from './client'; // [!code --] // 👎
import type { Pet } from './client/types.gen'; // [!code ++] // 👍
Examples
You can view live examples on StackBlitz.
Sponsors
Love Hey API? Become our sponsor.