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.
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:
- Specify the input file path using the flag
-i
- Specify the desired language using the flag
-g
- 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/