Speakeasy Logo
Skip to Content

Deprecations

The OpenAPI Specification allows deprecating parts of an API, such as methods, parameters, and properties. When deprecating a part of an API, the SDK will generate relevant deprecated annotations in the code and add a ⚠️ Deprecated label to the SDK docs.

In addition to labeling deprecated parts of an API, Speakeasy extensions are available to customize the messaging of deprecated items.

Deprecate Methods

Deprecate methods in an SDK using the deprecated field in the OpenAPI schema. This will add a deprecated annotation to the generated method and a ⚠️ Deprecated label to the SDK docs.

Use the x-speakeasy-deprecation-message extension to customize the deprecation message displayed in code and the SDK docs.

Use the x-speakeasy-deprecation-replacement extension to specify the method that should be used instead of the deprecated method.

Deprecate Parameters

Deprecate parameters in an SDK using the deprecated field in the OpenAPI schema. This will add a deprecated annotation to the corresponding field in the generated objects and remove the parameter from any relevant usage examples in the SDK docs.

Use the x-speakeasy-deprecation-message extension to customize the deprecation message displayed in code and the SDK docs.

Deprecate Properties

Deprecate properties in an SDK using the deprecated field in the OpenAPI schema. This will add a deprecated annotation to the corresponding property in the generated objects and remove the property from any relevant usage examples in the SDK docs.

Use the x-speakeasy-deprecation-message extension to customize the deprecation message displayed in code and the SDK docs.

Last updated on