You are not logged in. Click here to log in.

Codebeamer Application Lifecycle Management (ALM)

Search In Project

Search inClear

Tags:  not added yet

Swagger documented Rest API

Swagger

API design is prone to errors, and it’s extremely difficult and time-consuming to spot and rectify mistakes when modeling APIs. More information here: https://swagger.io


Why Swagger

Swagger built for designing APIs with the OpenAPI Specification (OAS), and has continued to meet the needs of developers building APIs with OAS. Swagger validates our design in real-time, checks for OAS compliancy, and provides visual feedback on the go.


How to use Rest API

End points are available on /v2/swagger/editor.spr url, without any authentication, please note that in order to use a rest API end point your user need to have 'api_permission'.


First steps

Please visit <site url>/v2/swagger/editor.spr url for a built in API tester (e.g. http://localhost:8080/cb/v2/swagger/editor.spr).


First you need to authenticate to use any API endpoint, click on the "Authorize" button and use you username and password



After you authenticated, you can use any API endpoints, to see the avalaible API endpoints, please click on the group name


In order to execute an API, please click on the "Try it out" button


Set a ID of your tracker item and click on the "Execute" button


After the execution, you should see the a Curl example of your request, and the result itself


In case of the ID of tracker item is not valid, you should see a 404 error code and an error message in the response


Examples are also provided for complex API

Ways to generate a swagger client

Check out our GutHub repository

If you want to integrate the Swagger client generated code into your build process, you can check our GitHub repository: https://github.com/Intland/swagger

You will find multiple maven modules:

  • to generate the client code
  • to authenticate
  • to create a tracker item
  • to create a report
  • to move tracker items between states

Register on swaggerHub

You can register on swaggerHub and import our swagger.json, please use the /v2/swagger.json to download it.

Use openapi-generator-cli

You can find the latest generator here: https://github.com/openapitools/openapi-generator


Following command generate a java client based on the swagger.json, please use the /v2/swagger.json to download it.


Create a config.json with

{"dateLibrary":"joda"}


Run the following command

 java -jar openapi-generator-cli-3.3.4.jar generate -i swagger.json -g java -c config.json -o <OUTPUT directory> --api-package <package name> --artifact-id=<artifact id>