Options
All
  • Public
  • Public/Protected
  • All
Menu

SAP Cloud SDK for JavaScript Logo

@sap-cloud-sdk/openapi-generator (Beta)

This packages contains the generator to create your own service module using a OpenAPI specification. 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.

Installation

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

$ npm install @sap-cloud-sdk/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 '@sap-cloud-sdk/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);

For more detailed overview visit our generator documentation.

Support

The recommended way to get in touch with us is to create an issue in our github repository. Select the issue category Bug, Feature or Question depending on the nature of your request. We try to provide fixes, features and answers as soon as possible.

We also monitor questions on StackOverflow and ansers.sap.com but prefer issues on github.

Contribute

If you would like to contribute to the SAP Cloud SDK, please make yourself familiar with our contributing guidelines and follow the given instructions.

Links

Licence

The SAP Cloud SDK is released under the Apache License Version 2.0.

Index

Interfaces

Functions

Functions

generate

  • experimental

    This API is experimental and might change in newer versions. Use with caution. Main entry point for OpenApi client generation. Generates files using the OpenApi Generator CLI and wraps the resulting API in an SDK compatible API.

    Parameters

    Returns Promise<void>