Swagger UI

A live version of the HCL Commerce REST API is available in a web browser on your HCL Commerce test server using the Swagger UI. It is composed of a set of static HTML, CSS, and JavaScript that dynamically documents the available REST API on the HCL Commerce test server.

Note:

From version 9.1.6 onwards, the Swagger UI is not provided with the HCL Commerce Rest APIs. To view the Rest APIs using Swagger UI, use the Swagger Editor.

For more information, see REST API.

Important:
  • For security reasons, Swagger should not be exposed in your live production environment.

    You can restrict it from being exposed in the following ways:

    • If the REST API ports are not required to be exposed externally, ensure that they are blocked by your firewall rules. These ports include 5443, 3738, 9443, 30901, 30921, and 30801.
    • If you need to expose these ports:
      1. Disable the REST Discovery API for the Transaction server. For more information, see Enabling and disabling the REST Discovery API.
      2. Ensure that you configure your web server to block access to the following swagger endpoints:
        • https://commerceHostname:3738/search/resources/swagger
        • https://commerceHostname:9443/commerceue/extension/swagger
        • https://commerceHostname:30901/search/resources/swagger
        • https://searchHost:30921/search/resources/swagger
        • https://searchHost:30801/swagger-ui.html#/
  • The Swagger UI is provided to you as-is. It contains the HCL Commerce REST API and other information that is related to the Swagger backend. Customizing the Swagger UI, for example, to display custom resource handlers, annotations, or extra data is not supported.

The following screen capture shows the home page of the Swagger UI:
Swagger UI screen capture
Where:
  • Each resource handler class is displayed with a short description of the service.
  • Show/Hide expands or collapses the API content of each class.
  • List Operations displays a summarized view of the API content, where a row is displayed for each method's path, with a short description of the service.
  • Expand Operations displays an expanded view of the API content, where rows are displayed for each method's response class, parameters, and status codes. The API can be dynamically tested by selecting Try it out! in the expanded view.
  • Raw displays the raw information that the Swagger UI uses to populate the page.