Generating Swagger/OpenAPI documentation

Generate comprehensive REST API documentation that includes both API Javadoc and Swagger/OpenAPI specifications by using Ant build commands in your Sterling™ Order Management System runtime environment.

Before you begin

Ensure that your Sterling Order Management System runtime environment is properly configured with the following components:

  • DTK (Development Toolkit) installed
  • Runtime environment set up in the runtime/ directory
  • Ant build tools available

About this task

You can generate the Swagger/OpenAPI documentation by using two different approaches depending on your needs.

Procedure

  1. Navigate to your runtime directory.
    cd runtime/bin
  2. Choose one of the following generation options.
    • Option 1: Generate complete documentation (recommended approach)

      Generate both API Javadoc and Swagger documentation:

      ./sci_ant.sh -f ../properties/xapiDeployer.xml alldocs

      This command completes the following tasks:

      • Generates API Javadoc from source code.
      • Creates OpenAPI JSON specifications.
      • Generates interactive HTML documentation.
      • Builds searchable API index.

      Time: 10-15 minutes (first run)

    • Option 2: Generate only Swagger documentation (faster approach)

      If API Javadoc already exists, regenerate only Swagger documentation:

      ./sci_ant.sh -f ../properties/xapiDeployer.xml swaggerdoc.generate

      This command completes the following tasks:

      • Regenerates OpenAPI JSON specifications.
      • Updates HTML documentation.
      • Rebuilds API search index.

      Time: 3-5 minutes

Results

After generation, the documentation is available at the following location:

runtime/xapidocs/swaggerdoc/
├── JSON/           # OpenAPI 3.0 specifications
├── HTML/           # Interactive HTML documentation
├── index.html      # Main entry point
└── api-index.js    # Search index

What to do next

Accessing the documentation

Open the main documentation page in your browser by using one of the following methods:

  • Local file system: file:///path/to/runtime/xapidocs/swaggerdoc/index.html
  • Web server: http://your-server/xapidocs/swaggerdoc/index.html