Is it possible do disable swagger page

Hi,

Is it possible do disable swagger page from an enviroment?

Best Regards,
Vasco Batista

Solution

Hi Vasco,

There is no way I know of in OutSystems.
What might be possible is writing a rule to deny access to a swagger.json endpoint. There might be a way using a web application firewall for example.

Regards,

Nordin

Solution

Hi Nordin,

Thanks for your reply, i will propose that solution.

Best Regards,
Vasco

Hi Vasco,

One more thing you can try is using SEO rules in service center and redirect all requests on swager page to some other page like some custom 404 page or something.

Good thinking Nikhil. Silly I haven’t even thought of that, but yeah I think that should work too!

Hi Vasco,

In your exposed API, 


Turn this setting to no.

Hi Bas,

Nice, I never took note of that option :).

I've just verified that this option indeed disables the SwaggerUI documentation page which can normally be found at https://hostname/ModuleName/rest/RESTAPI/RESTAPIMethod. The page will result in a blank page if you set the Documentation parameter to 'No'.

However, the OP should take note that the swagger.json file of the RESTAPI can still be reached - even if the Documentation parameter is set to 'No' - at https://hostname/ModuleName/rest/RESTAPI/swagger.json.

Regards,

Nordin


Nordin Ahdi wrote:

Hi Bas,

Nice, I never took note of that option :).

I've just verified that this option indeed disables the SwaggerUI documentation page which can normally be found at https://hostname/ModuleName/rest/RESTAPI/RESTAPIMethod. The page will result in a blank page if you set the Documentation parameter to 'No'.

However, the OP should take note that the swagger.json file of the RESTAPI can still be reached - even if the Documentation parameter is set to 'No' - at https://hostname/ModuleName/rest/RESTAPI/swagger.json.

Regards,

Nordin



Glad it worked! Can you mark my post as an answer?

I'm afraid I can't since I'm not the Original Poster :). 

That one is for Vasco to decide.

Or an MVP ;)

True, an MVP has those powers too :)

Hi Guys,

One thing about Bas de Jong solution, i had already tried it and in fact the swagger.json can still be reached.
Think Nikhil solution is one also to try, but already proposed Nordi solution and so i'll mark that one as the answer.

Thanks to all,
Best Regards,
Vasco