Extension for hidden endpoints

171 views
Skip to first unread message

Gary Bisaga

unread,
Sep 16, 2014, 9:40:19 AM9/16/14
to swagger-sw...@googlegroups.com
Hi, I am just getting into Swagger 2.0 and I love the new capabilities. What I'd like to do is define a "hidden" extension that lets us hide endpoints. We have frequent releases and often code gets developed and deployed, but that code is not officially released, so I don't want it to show up in the documentation. I am thinking that defining a new "x-hidden: true" option at the operation level would be useful. Then I would have to modify the static HTML generator as well as the swagger UI to deal with this new option. Does this sound like the right way to do this kind of thing? Any hints of where to start looking in the source code to "hide" endpoints in this way? Thanks!

Ron

unread,
Sep 16, 2014, 9:47:33 AM9/16/14
to swagger-sw...@googlegroups.com
You need to understand that it would hide it only from the UI point of view and not the actual documentation. Should a developer choose to look at your swagger.json, they will still see it.

This is also a top-bottom or bottom-up question. If you're generating your documentation from swagger-editor and generate your code from it, then that may be the way to go.
If you're generating the documentation directly from the code, then whichever library you're using may have the option to hide or filter operations entirely when swagger.json is being generated and then there would be no need for that extension. That way, even if a user/developer chooses to look at the raw swagger.json, they won't see the operations that are currently being developed.

On 16 September 2014 16:40, Gary Bisaga <gary....@pearson.com> wrote:
Hi, I am just getting into Swagger 2.0 and I love the new capabilities. What I'd like to do is define a "hidden" extension that lets us hide endpoints. We have frequent releases and often code gets developed and deployed, but that code is not officially released, so I don't want it to show up in the documentation. I am thinking that defining a new "x-hidden: true" option at the operation level would be useful. Then I would have to modify the static HTML generator as well as the swagger UI to deal with this new option. Does this sound like the right way to do this kind of thing? Any hints of where to start looking in the source code to "hide" endpoints in this way? Thanks!

--
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