A project containing generator templates and template helpers for OpenAPI Generator Plus
This project uses nvm for managing the versions of node, and pnpm for installing packages and managing the monorepo project structure.
To setup nvm
:
nvm install
nvm use
To install pnpm:
npm -g install pnpm
To install and build the project:
pnpm install
pnpm build
pnpm watch
To run the tests:
pnpm test
If you're making changes to core at the same time:
openapi-generator-plus
workspace, execute pnpm run link
, then pnpm watch
pnpm run link
, then pnpm watch
OpenAPI Generator Plus has its own object model for representing the API specification. Templates from other generators must be rewritten or modified. This is usually not a complicated process as the properties available to templates are well-defined by TypeScript interfaces.
OpenAPI Generator Plus uses Handlebars for templating. Handlebars builds on the functionality of the mustache templates used in swagger-codegen making templates more powerful and easier to customise. Handlebars also supports custom helpers to put more capability into templates, such as case transformations.
The handlebars-templates package includes a number of helpers that are used throughout the generator templates.