Swagger Documentation

The OpenAPI Specification, formerly known as Swagger, describes a REST API in a form that both people and programs can read. The Next-Generation IEDB Tools API publishes an OpenAPI interface for its endpoints. From there you can read each endpoint’s parameters and send test requests from the browser.

swagger.png

Usage

Each endpoint is listed with its request method (GET, POST, PUT, DELETE), its path, and a one-line description.

The GET request for the Cluster parameters is one example: swagge-cluster-ex.png

Selecting the row expands it to show the request’s description, parameters, and responses. swagge-cluster-ex1.png This request takes no input, so its Parameters section reads No parameters.

Select Execute.

The Responses section then shows the server response.

swagger-cluster-ex4.png

The section opens with the Curl command for the request and the Request URL.

Curl and Request URL

To get the same response body outside the UI, run the curl command in a terminal or open the Request URL in a browser.

Below those, Server response contains the response body, the response headers, and the request duration. The body lists every Cluster parameter in JSON.

Request with Parameters

The allele search endpoint takes parameters:

swagger-allelesearch.png

Its five parameters are query, limit, toolsname, predictor, and prefix_restriction. The last restricts results to one locus, such as HLA-B.

The text boxes are disabled until you select Try it out. Fill four of them with these values and leave prefix_restriction empty:

  • query: 0201

  • limit: 5

  • toolsname: mhci

  • predictor: netmhcpan

The response is the five NetMHCpan alleles that match 0201 most closely.

Select Execute to run the request.

The response body lists the five closest matches: swagger-allelesearch2.png