Skip to content

Repository files navigation

Avatar

Build Status Code Scanning Status Security Status

Generator-OpenAPI-Generator

Generator-OpenAPI-Generator is an OpenAPI Generator projects generator using Plop.

It provides the following components:

Component Description
oag-file-spec Generate a project to generate OpenAPI Generator using a file specification.
oag-url-spec Generate a project to generate OpenAPI Generator using a URL specification.

All components are built using Swaggy C.

Usage

Generate OAG with file specification project:

make generate-oag-file-spec

Generate OAG with URL specification project:

make generate-oag-url-spec

Both components will prompt you the following inputs:

Prompt Description
Project ID Used for package names and project repo name.
Project Name Used in documentation or comments.
Project Description Used in documentation or comments.
Author Name The name of the project author.
Author Email The email of the project author.
Author URL The author's website URL.
GitHub ID The GitHub ID of the project repo.
GitHub Actions token prefix Prefix for the GitHub token secret used in GitHub Actions workflows.

Move to the generated project directory:

cd stage/<component>/

Usage With Config File

Each component also has a -with-config target that skips the interactive prompts by reading the inputs from a Swaggy C YAML config file. See examples/ for sample config files for each component.

Pass the config file path via the GENERATOR_CONFIG variable, it defaults to swaggy-c.yml:

make generate-oag-file-spec-with-config GENERATOR_CONFIG=path/to/swaggy-c.yml
make generate-oag-file-spec-partials-with-config GENERATOR_CONFIG=path/to/swaggy-c.yml
make generate-oag-url-spec-with-config GENERATOR_CONFIG=path/to/swaggy-c.yml
make generate-oag-url-spec-partials-with-config GENERATOR_CONFIG=path/to/swaggy-c.yml

Initial configuration file for each OAG language:

make init-generators-config

For the primary languages, modify the configuration file to include the following:

(NOTE: configuration properties can be found in the OpenAPI Generator Mustache templates

Javascript

{
  "projectName": "<project_id>",
  "packageName": "<project_id>",
  "packageVersion": "<version>",
  "gitUserId": "<github_id>",
  "gitRepoId": "<project_id>"
}

Python

{
  "projectName": "<project_id>",
  "packageName": "<project_id>",
  "packageVersion": "<version>",
  "packageUrl": "https://github.com/<github_id>/<project_id>",
  "gitUserId": "<github_id>",
  "gitRepoId": "<project_id>"
}

Ruby

{
  "gemName": "<project_id>",
  "moduleName": "<ProjectId>",
  "gemVersion": "<version>",
  "gemAuthor": "<author_name>",
  "gemAuthorEmail": "<author_email>",
  "gemHomepage": "https://github.com/oapicf/<project_id>",
  "gemLicense": "MIT",
  "gemRequiredRubyVersion": ">= 3.0",
  "gitUserId": "<github_id>",
  "gitRepoId": "<project_id>"
}

Colophon

Developer's Guide

Build reports:

Related Projects:

  • Swaggy C - Builder for OpenAPIGenerator-generated API clients in multiple languages

About

OpenAPI Generator projects generator using Plop

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages