Skip to content

Repository files navigation

OpenAPI Generator Plus Generator Templates

A project containing generator templates and template helpers for OpenAPI Generator Plus

Available generator templates

TypeScript

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.

Java

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.

Documentation

Template Description
plain-documentation Plain text documentation of the API.

Building

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

Linking with OpenAPI Generator Plus Core

If you're making changes to core at the same time:

  1. In the openapi-generator-plus workspace, execute pnpm run link, then pnpm watch
  2. In this workspace, execute pnpm run link, then pnpm watch

Templates

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.

Handlebars

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.

About

No description, website, or topics provided.

Resources

Stars

20 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages