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