How can I use Swagger to generate documentation/specification for a subset of my APIs?

74 views
Skip to first unread message

Julius Depulla

unread,
Jun 19, 2017, 1:31:50 PM6/19/17
to Swagger
I know swagger generates specification/documentation for all operations/methods in an API.
Can I configure swagger to generate documentation for a subset of the operations/methods in the API.
E.g. An API with 7 methods/operations, I only want to document/expose 3 out of the 7. 

How can I use Swagger to generate documentation/specification for a subset of my APIs?

Does swagger support this use case scenario? If it does, how do I achieve this?

Ron Ratovsky

unread,
Jun 19, 2017, 4:39:23 PM6/19/17
to swagger-sw...@googlegroups.com

That really depends on which library you use… can you provide more details?

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

Julius Depulla

unread,
Jun 20, 2017, 4:18:47 AM6/20/17
to Swagger
Hi Ron,

My API is built using ASP.NET Web API. I am using Swashbuckle Nuget package. 
Can you please tell me which library supports my use case. Imagine I have 7 or more operations/methods on my API and I want to make available only 3 of the operations to a specific client.
I do want to provide swagger documentation for only the 3 operations and make them available to the client. The other 4 operations, I can make available to another client/integrator and provide documentation for the other 4 operations. Basically, I am segmenting or grouping my operations in my API and making the available to clients.

Which package you offer, does support this use case scenario. If  none of your products support this, I may change my design. 
Your feedback is greatly appreciated

Julius Depulla

unread,
Jun 20, 2017, 10:31:24 AM6/20/17
to Swagger
Hi Ron,

My API is built using ASP.NET Web API. I am using Swashbuckle Nuget package. 
Can you please tell me which library supports my use case. Imagine I have 7 or more operations/methods on my API and I want to make available only 3 of the operations to a specific client.
I do want to provide swagger documentation for only the 3 operations and make them available to the client. The other 4 operations, I can make available to another client/integrator and provide documentation for the other 4 operations. Basically, I am segmenting or grouping my operations in my API and making the available to clients.

Which package you offer, does support this use case scenario. If  none of your products support this, I may change my design. 
Your feedback is greatly appreciated

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.

Ron Ratovsky

unread,
Jun 20, 2017, 2:20:59 PM6/20/17
to swagger-sw...@googlegroups.com

Swashbuckle is a community project and not one of our own. I don’t know if it provides that functionality or not.

I’d suggest referring to the project’s documentation, and if you can’t find the answer, file a ticket on the project.

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.

--

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.

Julius Depulla

unread,
Jun 20, 2017, 3:10:20 PM6/20/17
to Swagger
Hi Ron,

Do you have or know a product that supports my use case scenario, either your own or not.
Many thanks for your help.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
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-swaggersocket+unsub...@googlegroups.com.

Bryan Nelson

unread,
Jun 20, 2017, 3:51:36 PM6/20/17
to Swagger
Perhaps I'm misunderstanding the ask here...but I've managed to suppress documentation on certain operations in a class in the Java implementation doing something like this:

@POST
@Path("myservice")
@ApiOperation(value = "Undocumented",
hidden = true)
public Response getMyData(@Context SecurityContext securityContext, @Context HttpHeaders headers, @Context HttpServletRequest servletRequest) { 
                   ...
               }

Notice the "hidden = true" element.  Perhaps Swashbuckle has something like that which you can look into?

Ron Ratovsky

unread,
Jun 20, 2017, 3:56:56 PM6/20/17
to swagger-sw...@googlegroups.com

Wrong language, Bryan. ;)

 

Julius, we don’t offer any .net solutions. I’ve already suggested a few next steps.

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.

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

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

Bryan Nelson

unread,
Jun 20, 2017, 4:00:21 PM6/20/17
to Swagger
That's why I said maybe Swashbuckle "has something like that".  ;)

If not...it should be added.  :p

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
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-swaggersocket+unsub...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
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-swaggersocket+unsub...@googlegroups.com.

Julius Depulla

unread,
Jun 20, 2017, 4:56:24 PM6/20/17
to Swagger
Hi Bryan,

Thanks for your response @Bryan. I am using .NET. @Ron suggests I raise a ticket for the feature/use case scenario to be added to Swashbuckle . 
Reply all
Reply to author
Forward
0 new messages