Parsed service.
The generated code for the SDK API wrapper.
Workaround for OpenAPI generation to build one and only one API for all tags. Modify spec to contain only one 'default' tag.
OpenAPI JSON document.
The modified document.
Convert Swagger documents to OpenAPI documents. If an OpenAPI document is passed it is not modified.
OpenAPI version 2 (Swagger) or 3 document to be converted to version 3.
A promise of an OpenAPI version 3 document.
Convert an OpenAPI document to ensure smooth parsing and generation thereafter. Documents are expected to be formatted as JSON, OpenAPI version 3 and only have one "default" tag.
File content of the original spec.
Path of the directory to write to.
Name of the file to write
Content to be written to the file. A copyright statement will be added to this.
Whether or not existing files should be overwritten.
Options to configure generation.
Get the operation for the given method and merge path parameters with operation parameters.
Path Item to get the operation from.
HTTP method to get the operation for.
The sanitized original operation.
Get the mapped TypeScript type for the given original OpenApi type.
Original OpenApi type, to get a mapping for.
The mapped TypeScript type.
The index file contents.
Type guard to check whether an object is of type
OpenAPIV3.ArraySchemaObject
.
Object to check.
True if the object is a array schema object, false otherwise.
Type guard to check whether an object is of type
OpenAPIV3.ReferenceObject
.
Object to check.
True if the object is a reference object, false otherwise.
Methods supported by OpenApi and SAP Cloud SDK.
Collect and parse all operations of an
OpenAPIV3.Document
.
The OpenApi document to parse.
List of cross references that can occur in the document.
A flat list of parsed operations.
Parse a JSON or YAML file and return it as JSON.
Path to the file
JSON representation of the given file.
Parse parameters of an operation.
The original operation definition.
List of cross references that can occur in the document.
A list of parsed parameters.
Parse the request body.
Original request body to parse.
List of cross references that can occur in the document.
The parsed request body.
Parse the type name of a reference object.
Reference object to get the type name from.
Parsed type name.
Check whether the given object is a reference object and resolve if necessary. This operates only on the current level and does not resolve the object recursively.
Object to resolve if necessary.
References to resolve by.
A resolved object.
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
Usage (CLI)
generate-openapi-client autocomplete [SHELL]
generate-openapi-client help [COMMAND]
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);
Documentation
Getting started guide API documentation
Helpful Links