Understand the client generation pipeline
masterThe npm run generate command executes scripts/generate.sh, which follows these steps:
- Spec Retrieval:
pull_spec.jsdownloads and filters the OpenAPI spec intosrc/openapi.json. It filters out draft paths, forces thedefaulttag to ensure a singleDefaultApiis emitted, and applies operation-id renames viaoperation-mappings.js. - Code Generation: Uses
openapi-generator-cliwith thetypescript-axiosgenerator. It targetssrc/restusing custom templates located intemplates/typescript-axiosand applies specific flags:supportsES6,stringEnums, anduseSingleRequestParameter. - Existence Gate: The process aborts if
src/rest/api.tsis not produced, preventing a partial or empty generation from overwriting the existing client.
Note: Only files in src/rest are overwritten. Files in src/main.ts, src/websockets/, README.md, package.json, and templates/ are preserved.