Skip to main content

Docs

Installโ€‹

npm install @basketry/typescript-docs

Basic Usageโ€‹

basketry.config.json
{
"source": "petstore.json",
"parser": "@basketry/openapi-3",
"generators": ["@basketry/typescript-docs"],
"output": "src"
}

File Structureโ€‹

This generator will create an markdown file for each service defined by the source schema. Each file will contain a description of the service, its methods, their parameters, and all responses. All types referenced by the service will be included in the documentation. Some common types may be duplicated across multiple documentation files if they are used by multiple services.

my-project/
โ”œโ”€โ”€ node_modules/
โ”œโ”€โ”€ src/
โ”‚ โ”œโ”€โ”€ v1/ <-- generated
โ”‚ โ”‚ โ””โ”€โ”€ pet-service.md <-- generated
โ”‚ โ”‚ โ””โ”€โ”€ types.ts
โ”‚ โ”œโ”€โ”€ index.ts
โ”œโ”€โ”€ .gitignore
โ”œโ”€โ”€ basketry.config.json
โ”œโ”€โ”€ package.json
โ”œโ”€โ”€ petstore.json
โ””โ”€โ”€ README.md

Optionsโ€‹

This generator depends on the @basketry/typescript generator and all of their applied options will also apply to files emitted by this generator.

See:

The @basketry/typescript-docs generator does not accept any of its own options.