1.38.0 • Published 3 years ago

@tomfrenken/openapi-generator v1.38.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
3 years ago

SAP Cloud SDK OpenAPI Client Generator (Beta)

Generate custom JavaScript/TypeScript clients for services with OpenAPI specifications. This generator is based on the OpenAPI Tools generator for OpenAPI and adds some additional code for convenience to better integrate with the SAP Cloud SDK.

Prerequisites

The official OpenAPI generator is Java based, therefore you need to have a Java runtime installed to use the SAP Cloud SDK OpenAPI generator.

Installation

$ npm install @tomfrenken/openapi-generator

Usage (CLI)

generate-openapi-client autocomplete [SHELL]

display autocomplete installation instructions

USAGE
  $ generate-openapi-client autocomplete [SHELL]

ARGUMENTS
  SHELL  shell type

OPTIONS
  -r, --refresh-cache  Refresh cache (ignores displaying instructions)

EXAMPLES
  $ generate-openapi-client autocomplete
  $ generate-openapi-client autocomplete bash
  $ generate-openapi-client autocomplete zsh
  $ generate-openapi-client autocomplete --refresh-cache

See code: @oclif/plugin-autocomplete

generate-openapi-client help [COMMAND]

display help for generate-openapi-client

USAGE
  $ generate-openapi-client help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI

See code: @oclif/plugin-help

Usage (programatically)

import { generate } from '@tomfrenken/openapi-generator';

// initialize generator options based on what you want to do
// note that inputDir and outputDir are mandatory
const options: GeneratorOptions = {
  inputDir: 'path/to/inputDir',
  outputDir: 'path/to/outputDir'
};

// generates the files and writes them to the outputDir
await generate(options);

Documentation

Getting started guide API documentation

Helpful Links