Many of the execute and management REST API methods in a Corticon Server WAR file can be exposed in Swagger, the popular OpenAPI Specification tool for describing, producing, consuming, and visualizing REST Web services. Swagger is built-in to every Corticon Server WAR file.

You can use Swagger through BASIC authentication and HTTPS connections.

Note: Get more information about Swagger at swagger.io

Enabling Swagger

To enable Swagger on a Server installation:
  1. Confirm that the installation has <Corticon_Home>/Server/lib/CcSwagger.jar.
    Note: If the installation does not have the Swagger JAR, such as when you use Docker, go to the Progress download site, and then navigate to PROGRESS_CORTICON_xx_SERVER.zip > PROGRESS_CORTICON_xx_WAR_CONTAINER.zip > Swagger > CcSwagger.jar.
  2. Copy CcSwagger.jar, and then paste it into <Tomcat>/webapps/axis/WEB-INF/lib. That effectively adds the JAR to the server classpath.
  3. Edit <Tomcat>/webapps/axis/WEB-INF/web.xml to change the parameter value for enabling Swagger to true:
    <init-param>
      <param-name>corticon.swagger.enabled</param-name>
      <param-value>true</param-value>
    </init-param>
  4. Save your edited file, and then restart the server.
  5. In your browser enter http://localhost:8850/axis/swagger/
The Corticon Server REST APIs page opens, as shown:

Accessing Swagger on a Corticon Server for Java

To access Swagger and the exposed REST methods, enter the following URL into a browser on a machine where Corticon Server is installed and running:
http://localhost:port/context/swagger
where the URL for typical local installation using HTTP is:
http://localhost:8850/axis/swagger
Note: For information about using Swagger, see the web services topic Test the installed Corticon Server on Java.

Adjusting Swagger access for custom ports and contexts

If you want to specify a preferred port or a context other than axis, you need to adjust some Swagger configurations.

To use a different port, for example for secure HTTP on port 8851:

  1. Edit the file:
    [CORTICON_HOME]\Server\tomcat\webapps\axis\swagger\index.html
    to change the url line to:
    url = "https://localhost:8851/axis/corticon/swagger.json";
    and then save the file.

To use a different context, for example Java_UAT:

  1. Stop the server.
  2. Edit the file:
    [CORTICON_HOME]\Server\tomcat\webapps\axis\swagger\index.html
    to change the url line to:
    url = "https://localhost:8851/Java_UAT/corticon/swagger.json";
    and then save the file.
  3. Edit the file:
    [CORTICON_HOME]\Server\tomcat\webapps\axis\web.xml
    to change the swagger.api.basepath parameter value to:
    <param-value>/Java_UAT/corticon</param-value>
    and then save the file.
  4. Restart the server.

Disabling Swagger on a Server

To disable Swagger on a Server, edit its web.xml file to add comment markers as shown:
<servlet>
    <servlet-name>Corticon REST Service</servlet-name>
    <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
    <init-param>
    <param-name>javax.ws.rs.Application</param-name>
    <param-value>com.corticon.eclipse.rest.CorticonRestApplication</param-value>
    </init-param>
    <!-- Swagger documentation for the REST APIs -->
 <!-- disable Swagger
    <init-param>
    <param-name>com.sun.jersey.config.property.packages</param-name>
    <param-value>io.swagger.jaxrs.json;com.corticon.eclipse.rest;
                 io.swagger.jaxrs.listing</param-value>
    </init-param> 
-->
    <!-- End of Swagger documentation for the REST APIs -->
and

    <!-- Swagger Rest API documentation -->
 <!-- disable Swagger
    <servlet>
    <servlet-name>DefaultJaxrsConfig</servlet-name>
    <servlet-class>io.swagger.jaxrs.config.DefaultJaxrsConfig</servlet-class>
    <init-param>
    <param-name>api.version</param-name>
    <param-value>1.1.8</param-value>
    </init-param>
    <!-- Change this if you deployed you server in a different location -->
    <init-param>
    <param-name>swagger.api.basepath</param-name>
    <param-value>/axis/corticon</param-value>
    </init-param>
    <load-on-startup>2</load-on-startup>
    </servlet>
--> 

When you restart the server, access to Swagger on the Server is disabled. Clear the comment delimiters to again enable Swagger on the server.