Can we disable Try now button

2,764 views
Skip to first unread message

venkatesh g

unread,
Dec 12, 2013, 12:03:40 PM12/12/13
to swagger-sw...@googlegroups.com
Can we disable 'Try now' button in Swagger documentation. Reason being, some of the Restful API, we do not want User to execute. If yes, please share the steps or tutorial link.


tony tam

unread,
Dec 12, 2013, 12:32:53 PM12/12/13
to swagger-sw...@googlegroups.com
You can hack the CSS to do this--take a look in the swagger-ui issues for a work-around

venkatesh g

unread,
Dec 12, 2013, 8:32:15 PM12/12/13
to swagger-sw...@googlegroups.com
Can you please share the link or procedure. We need to disable 'Try now' button only for certain APIs

tony tam

unread,
Dec 13, 2013, 2:31:19 AM12/13/13
to swagger-sw...@googlegroups.com
Yes--consider the petstore sample here:



You can disable the "/pet/{petId}" try-it-now button with this in the <head> element of index.html:

  <style>
    #pet_getPetById_get_0_content > form > div.sandbox_header > input {
      display: none !important;
    }
  </style>

Tejas Dewan

unread,
Jul 14, 2016, 6:31:37 AM7/14/16
to Swagger

tony tam

unread,
Jul 15, 2016, 1:16:02 AM7/15/16
to swagger-sw...@googlegroups.com
You can disable the try-it-out by setting the “supportedSubmitMethods":

see here:


On Jul 14, 2016, at 3:31 AM, Tejas Dewan <tejas...@gmail.com> wrote:

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages