cancel
Showing results for 
Search instead for 
Did you mean: 

How to disable Swagger in SAP Commerce?

SAPSupport
Employee
Employee
0 Kudos
279

Hello everyone,

We would like to know how to disable the Swagger UI feature from our API in SAP Commerce Cloud, but we are not able how to do so.

Thanks in advance.


------------------------------------------------------------------------------------------------------------------------------------------------
Learn more about the SAP Support user and program here.
View Entire Topic
Naveenmp
Newcomer
0 Kudos

It is possible to block the swagger UI on specific CCV2 environment using the Deny path sets.

Step1 : Create deny path set from ccv2. Ref link portal https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD/0fa6bcf4736c46f78c248512391eb467/a2865c97e...

Here sample txt file contains

# Deny swagger path:
DENY /{youroccextn}/v2/swagger-ui/index.html

DENY /{youroccextn}/v2/api-docs

DENY /{youroccextn}/v2/swagger-ui

DENY /{youroccextn}/v2/swagger-ui/

Step2 : Attach the created deny path set to the API endpoint of your desired environment. Ref (https://help.sap.com/docs/SAP_COMMERCE_CLOUD_PUBLIC_CLOUD/0fa6bcf4736c46f78c248512391eb467/b542707b5... Now test  your swagger URL. It will be blocked.