Types and Interfaces
Install
- npm
- yarn
- pnpm
npm install @basketry/typescript
yarn add @basketry/typescript
pnpm add @basketry/typescript
Basic Usage
basketry.config.json
{
"source": "petstore.json",
"parser": "@basketry/openapi-3",
"generators": ["@basketry/typescript"],
"output": "src"
}
File Structure
This generator will create a types.ts
file that contains all the types and interfaces for the API. By default, the file will be nested within a directory named after the API major version. This behavior can be disabled by using the includeVersion
option described below.
my-project/
├── node_modules/
├── src/
│ ├── v1/ <-- generated
│ │ └── types.ts <-- generated
│ ├── index.ts
├── .gitignore
├── basketry.config.json