Home

Awesome

IBM Cloud Java SDK Template

This repository serves as a template for Java SDKs that are produced with the IBM OpenAPI SDK Generator.

You can use the contents of this repository to create your own Java SDKs.

How to use this repository

1. Copy the repository

Copy the files contained in this repository as a starting point when building your own Java SDK for one or more IBM Cloud services.

2. Modify the copied files to reflect your SDK project

The following files will need to be modified after copying them from this template repository:

3. Generate the Java code with the IBM OpenAPI SDK Generator

This is the step that you've been waiting for!

In this step, you'll invoke the IBM OpenAPI SDK Generator to process your API definition.

This will generate a collection of Java classes which will be included in your SDK project. You'll find instructions on how to do this here.

The generated code for each service should be copied/moved to the modules/<service-name> directory. For example, if your service is called "my-cloud-service", then you should create a directory in your SDK project named "modules/my-cloud-service" and copy modules/example-service/pom.xml into that directory, then modify it according to the instructions contained within the file.

Pro tip: When you use the OpenAPI SDK Generator to generate the client SDK code for your service, you can use the -o command-line option to specify <your-sdk-project>/modules directory as the output directory. This will cause the generator to save the generated code directly into your SDK project's modules/<service-name> directory.