Generating a Client SDK

Last modified on October 20, 2021

SwaggerHub lets you generate client SDKs for APIs in JavaScript, Java, C#, Objective C, Swift, Android, and many other languages (the list is constantly expanding). A client SDK contains wrapper classes that you can use to call the API from your application without having to deal with HTTP requests and responses.

Anyone can generate an SDK for any API – you do not need a SwaggerHub account or to be an API owner.

Download a client SDK

  1. Open the API page in SwaggerHub.

  2. If the API has several versions, select the version for which you want to generate the code.

    Selecting an API version
  3. From the Export menu, select Client SDK, and then the desired language or framework.

    Note: Languages marked with an asterisk * use custom code generation options as configured by the API editors.
    Generating a client SDK for an API
  4. Download and unzip the SDK.

Code generation options

API owners can customize the code generation options for their APIs.

Custom client generators

SwaggerHub On-Premise allows companies to create and use custom code generators. To learn more, see Using Custom Codegen Templates.

I have downloaded the client SDK. Now what?

This depends on the language you are using. Usually, an SDK is not designed to work on its own – you will need to create an application that will use this SDK to make API calls. See the README.md file in the downloaded archive to get started.

See Also

Generating a Server Stub
Code Generation Options

Watch the video
 
Highlight search results