Publishing a REST API definition file

You can deploy a web project to a Liberty server or a WebSphere® Application Server traditional server. You can view the published application programming interface (API) definition file in a web browser.

Before you begin

Define or specify your REST API by creating the openapi.json or openapi.yaml file. For more information about creating the file, see Creating a REST API definition file.

Procedure

  1. Configure the server.xml file to enable the runtime environment to look for the openapi.json or openapi.yaml file.

    For more information about configuring the server.xml file, see Including configuration information from external xml files in the server.xml file.

  2. Start the server.

    For more information about starting a Liberty server, see Starting and stopping a server by using developer tools.

    For more information about starting a traditional server, see Starting a WebSphere Application Server traditional server.

  3. In the Servers view, right-click on the Liberty server and select Add and Remove.

    The previous steps also apply to Open API 2.0 (Swagger 2.0) files except that the files are called swagger.json or swagger.yaml.

  4. Select your web project, click Add, and then click Finish.
  5. To view the REST API definition file, open a browser window and go to https://localhost:9443/ibm/api/explorer/.