cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to disable Swagger in SAP Commerce?

SAPSupport
Employee
Employee
0 Likes
597

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.

Accepted Solutions (1)

Accepted Solutions (1)

SAPSupport
Employee
Employee
0 Likes

Hello!

To disable Swagger, you will need to remove the swaggerintegration extension from your build.

Kind Regards,
Wesley
Technical Support

Answers (1)

Answers (1)

Naveenmp
Newcomer
0 Likes

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.