ServiceStack + Swagger's ability to group resources in different ways

Let me start by saying that ServiceStack exceeded all my expectations as a framework. It is amazing what has been achieved.

I am currently using the Swagger UI plugin with ServiceStack and wondered if there is a way to group resources separately than they are now? The group seems to be dictated by the root.

The current grouping does something like this:

/clients /clients/{clientId}/locations/{id} /clients/{clientId}/locations/{locationId}/reports /clients/{clientId}/locations/{locationId}/reports/{id} 

I would prefer swagger ui to output something similar to this:

 Clients /clients/{id} Locations /clients/{clientId}/locations Reports /clients/{clientId}/locations/{locationId}/reports 

It would be great if you could do something like the one shown above using the grouping as shown below.

 [Route("/hello/{Name}", "GET", Summary = @"Says ""Hello"" to provided Name with GET.", Notes = "Longer description of the GET method which says 'Hello'", // like this! SwaggerGroup="Clients")] 

It might be a Swagger constraint rather than a ServiceStack constraint, but I thought I'd ask.

+4
source share
1 answer

ServiceStack does not make any changes to the Swagger UI . If this feature does not exist in Swagger, it will also not be available in ServiceStack.

However, the Swagger user interface is generated using static JavaScript and HTML in the / swagger-ui folder so that you can change the user interface and add any settings you need in your local copy.

+1
source

Source: https://habr.com/ru/post/1482675/


All Articles