A project containing generator templates and template helpers for OpenAPI Generator Plus
| Template | Runs in | Description |
|---|---|---|
| typescript-fetch-client2 | Browser | API client using Fetch. Generates a tree-shakeable function per operation, with strongly-typed responses. |
| typescript-fetch-node-client2 | Node | typescript-fetch-client2, using node-fetch and Node types. |
| typescript-fetch-rn-client | React Native | typescript-fetch-client, with the polyfills React Native needs. |
| typescript-express-example-server | Node | An example Express server. |
Legacy templates not recommended for new projects:
| Template | Runs in | Description |
|---|---|---|
| typescript-fetch-client | Browser | An earlier version of typescript-fetch-client2. Generates an API class per operation group. |
| typescript-fetch-node-client | Node | An earlier version of typescript-fetch-node-client2. |
| Template | Description |
|---|---|
| java-cxf-cdi-server | JAX-RS server using Apache CXF and CDI. |
| java-cxf-spring-server | JAX-RS server using Apache CXF and Spring. |
| java-cxf-client | JAX-RS client using Apache CXF. |
| java-jaxrs-client | JAX-RS client. |
| java-retrofit-client | Client using Retrofit. |
| Template | Description |
|---|---|
| plain-documentation | Plain text documentation of the API. |
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 useTo install pnpm:
npm -g install pnpmTo install and build the project:
pnpm install
pnpm build
pnpm watch
To run the tests:
pnpm testIf you're making changes to core at the same time:
- In the
openapi-generator-plusworkspace, executepnpm run link, thenpnpm watch - In this workspace, execute
pnpm run link, thenpnpm 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.