cancel
Showing results for 
Search instead for 
Did you mean: 

How can I disable Swagger in Production but enable Swagger in Development and Staging evironments?

geffchang
Active Contributor

Version: SAP Commerce 2205

How can I disable Swagger in Production environment but enable Swagger in Development and Staging evironments?

In the official Enabling or Disabling Swagger UI guide, it says I need to exclude the swaggerintegration extension. However, I assume this will affect environments.

Is it possible to configure what I need via manifest.json? If not, what is the best practice or approach for this?

adamreisberg
Active Participant
0 Kudos

Hi @geffchang 

Is this for ywebservices generated extensions, ycommercewebservices, or commercewebservices?

Accepted Solutions (0)

Answers (3)

Answers (3)

safin
Advisor
Advisor
0 Kudos

Hi, 

As far as i know, there is no way to disable Swagger in production environ and enable it in dev and staging, after all, there is no so called "persona" for extensions in manifest.json currently.

So for your requirement, my suggestion is to have two different buildings, one includes swaggerintegraiton and deploy to dev and staging, the other excludes swaggerintegration and deploy to production.

Thanks

Pradeeppai
Associate
Associate
0 Kudos

Unfortunately, you cannot directly configure Swagger UI via manifest.json file in SAP commerce cloud . You can only integrate it with swaggerintegration. There is no other approach as of now. 

Thanks and regards, 
Pradeep Pai Karkala 
SAP CX Product Support 

geffchang
Active Contributor
0 Kudos
@Pradeeppai Thank you for the comment. For the "swaggerintegration" approach, is it possible to enable Swagger for Production only, but disable them for DEV or STG? Would springfox.documentation.enabled property (existing key for Swagger 3.x) work in local.properties, when I upgrade to SAP Commerce 2211? At the moment, I can't test yet, since I am currently on SAP Commerce 2205.
Pradeeppai
Associate
Associate
0 Kudos
Not sure whether springfox.documentation.enabled property would work for SAP commerce , as it is not an OOTB property. Probably you can try testing it but I am not sure whether it will work
geffchang
Active Contributor
0 Kudos

@adamreisberg commercewebservices