Skip to main content

Package Publishing

SDK Generation can be run on an OpenAPI document without any prior configuration. The generator will use default values to allow you to just easily generate a SDK and see the output. The generator SDK can be used by importing the local package into your project as is. However, to productionize the SDK, and get it ready to publish to the relevant package manager you will likely want to configure the SDK for your needs.

Setup

The SDK Generator supports generating SDKs in a repo per language or in a monorepo containing SDKs for multiple languages.

To configure the generation create a gen.yaml file in one of two locations:

  • The root of your repo for either a repo per language or a monorepo.
  • The output directory of a particular language for a monorepo.

Configuration Options

All the configuration options below are optional.

configVersion: 1.0.0 # The version of the configuration file format. Managed by the Speakeasy CLI.
go:
packageName: "github.com/speakeasy-api/speakeasy-client-sdk-go" # The package name for the generated Go SDK. Should be based on the `go get` package name that would be used to get the SDK. Defaults to `openapi`.
version: "1.0.0" # A semantic version for the generated Go SDK. Defaults to `0.0.1`.
python:
packageName: "speakeasy-client-sdk-python" # The package name for the generated Python SDK. Should be based on the `pip install` package name that would be used to get the SDK. Defaults to `openapi`.
version: "1.0.0" # A semantic version for the generated Python SDK. Defaults to `0.0.1`.
author: "Speakeasy API" # A string representing the author used to populate the Python packages `setup.py` for details published to PyPi. Defaults to `Speakeasy`.
description: "Client SDK for the Speakeasy API" # A string representing the description used to populate the Python packages `setup.py` for details published to PyPi. Defaults to `Python Client SDK Generated by Speakeasy`.
typescript:
packageName: "@speakeasyapi/speakeasy-client-sdk-typescript" # The package name for the generated TypeScript SDK. Should be based on the `npm install` package name that would be used to get the SDK. Defaults to `openapi`.
version: "1.0.0" # A semantic version for the generated TypeScript SDK. Defaults to `0.0.1`.
author: "Speakeasy API" # A string representing the author used to populate the TypeScript packages `package.json` for details published to NPM. Defaults to `Speakeasy`.
java:
groupID: "dev.speakeasyapi" # The group ID for the generated Java SDK. Defaults to `org.openapis`.
artifactID: "javasdk" # The artifact ID for the generated Java SDK. Defaults to `openapi`.
projectName: "speakeasy-client-sdk-java" # The project name for the generated Java SDK. Defaults to `openapi`.
version: "1.0.0" # A semantic version for the generated Java SDK. Defaults to `0.0.1`.
ossrhURL: "https://oss.sonatype.org/service/local/staging/deploy/maven2/" # The URL for the OSSRH repository to use to publish the generated Java SDK.
php:
version: "1.0.0" # A semantic version for the generated PHP SDK. Defaults to `0.0.1`.
packageName: "speakeasyapi/speakeasy" # The package name for the generated PHP SDK. Defaults to `openapi/openapi`.
namespace: "SpeakeasyAPI\\Speakeasy" # The namespace for the generated PHP SDK. Defaults to `OpenAPI\\OpenAPI`.
generation:
comments:
disabled: false # A boolean indicating whether or not to include comments in the generated SDK. Defaults to `false`.
omitDescriptionIfSummaryPresent: false # A boolean indicating whether or not to omit the description of an operation if the summary is present. Defaults to `false`.
baseServerUrl: "https://api.speakeasyapi.dev" # The base server URL to use to make requests to the API. Needed if the OpenAPI document does not contain a `servers` object. Defaults to "".
telemetryEnabled: true # A boolean indicating whether or not to include telemetry in the generated SDK. Defaults to `false`.
sdkClassName: "Speakeasy" # The name of the class that will be used to instantiate the SDK. Defaults to `SDK`.