Skip to main content

Auto-generate an SDK for Vault

Learn how Piiano Vault supports auto-generating an SDK that you can integrate with your codebase

The OpenAPI file is available for download in two formats: JSON and YAML. Use one of these files and an OpenAPI generator to create the SDK client. We support any OpenAPI generator compliant with version 3.0.3. For example,
OpenAPI Generator or Swagger Codegen. Use these generators for languages not supported by the official SDKs.

info

While this guide provides examples based on openapi-generator, other generators may be more suitable for your use case. Selecting a generator and its configuration is a matter of preference and other implications that are out of scope for this guide.

Install OpenAPI Generator

For languages that do not have a code sample project, follow these instructions to manually generate the Vault SDK:

Using Homebrew

For MacOS with homebrew:

brew install openapi-generator

Using npm

npm install @openapitools/openapi-generator-cli -g

Using OpenAPI Generator's Docker Image

If you prefer using Docker without any installation:

docker run openapitools/openapi-generator-cli

Using the OpenAPI Generator

List the Available Programming Languages

Most common programming languages are supported by the generator. Verify that your language is supported by the generator by finding it in the list of available languages under the 'CLIENT generators' section:

openapi-generator list

Generate the client

Use the command generate with these arguments:

  1. Specify the input file path using the flag -i
  2. Specify the desired language using the flag -g
  3. Specify the output directory using the flag -o.
openapi-generator generate -i <openapi-file> -g <desired-language> -o <output-directory>

Examples:

Generate Python Client
openapi-generator generate -i openapi.yaml -g python -o python-sdk/
Generate Java Client
openapi-generator generate -i openapi.yaml -g java -o java-sdk/
Generate Go Client
openapi-generator generate -i openapi.yaml -g go -o go-sdk/
Generate Node JS Client
openapi-generator generate -i openapi.yaml -g javascript -o js-sdk/