Forge
Plugins

OpenAPI

Plugin for OpenAPI code generation

@bjb-forge/nx-openapi-project

Installation

npx @bjb-forge/cli add @bjb-forge/nx-openapi-project

Plugin Options

{
  "plugin": "@bjb-forge/nx-openapi-project/nx-plugin",
  "options": {}
}
OptionTypeDescription
build.targetNamestringThe name of the build target

Inferred Targets

build

Generates client/server code from OpenAPI specifications using openapi-generator.

Condition: All projects containing a generator-config.yml or generator-config.yaml

Generators

openapi-project

Create an OpenAPI client project.

nx g @bjb-forge/nx-openapi-project:openapi-project [options]
OptionTypeRequiredDefaultDescription
directorystringYes-A directory where the project is placed
namestringYes-Project name
specFilePathstringNoopenapi.yamlPath to the OpenAPI specification file
templatestringNotypescript-fetchOpenAPI generator template to use
outputDirstringNogeneratedOutput directory for generated code

On this page