Speakeasy Logo
Skip to Content

Creating Internal and External SDKs

To create two different versions of an SDK, one for internal use and one for external use, use JSONPath expressions in OpenAPI Overlays (a standard extension for modifying existing OpenAPI documents without changing the original). This approach dynamically targets and hides internal operations and parameters from the public SDK. The workflow.yaml file can be configured to include Overlays as part of the source definition.

Using the x-internal Extension

First, add an x-internal: true extension to all the operations, parameters, and other elements in the OpenAPI spec that should only be available in the internal SDK.

Using JSONPath Expressions in an Overlay

Next, use a JSONPath expression to remove all the internal paths and parameters from the SDK. This removal occurs specifically when generating the internal SDK.

Define a workflow that generates both the internal and external SDKs.

Last updated on