Skip to Content
Technical Articles
Author's profile photo Mohamed Vall BAH

How to activate swagger in SAP Commerce Cloud 2211


The goal of this article is to provide documentations needed when upgrading Swagger SAP Commerce to version 2211.

SAP best practices recommends to use swaggerintegration extension to automate the API documentation process and provide Swagger UI for your web services.

Activating Swagger in 2211

The basic steps to activate Swagger in SAP CC 2211 are

  • Include swaggerintegration into your localextensions.xml
  • [...]
    <extension name="swaggerintegration"/>
  • Run ant clean all
  • Restart the server
  • Perform an update system

If the swagger is still not working despite the actions above and you have 404 when loading the swagger in the browser

  • Check if you have restricted APIs configured in *.properties with following values
  • If it is the case, you have two options
    1. Authorise all endpoints with the following configuration to include swagger endpoints
    2. Keep the restrictions but allow swagger endpoints openapiJsonUsingGET and redirectToUiUsingGET

After doing this, you will be able to load the swagger correctly with the following address : https://<API_URL>/occ

Below some useful links if you need to do some advanced configurations

Link Comment
ApiDocInfoProvider Check this link to know how you can use the implementation of ApiDocInfoProvider interface to provide information for API Documentation
Integrate with swaggerintegration Extension Check this link to know how to integrate  with  swaggerintegration extension
Authorization Exclusion Check this link to see how you can exclude endpoints in your spring security config.
Customized Servlet Path Check this link if you have a customised servlet path
OAuth2 Configuration Check this link to know which configuration information about OAuth is needed
Enable/Disable Swagger U Check this link to know how to enable/disable swagger
OpenAPI Customizer Check this link if you want to customise your OpenAPI documentation with Springdoc


With the information provided above, you will be able to activate swagger API in SAP Commerce 2211 and gain visibility on the APIs exposed by your SAP Commerce implementation


Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.