ServiceStack.UseCases
ServiceStack.UseCases copied to clipboard
ServicaStack.Swagger captures only the first route in service
Go to HelloText class (or any class that is describing requests to REST service, i.e. HelloImage or Hello - in this particular example). Add one more route for the request.
[Route("/hellotext/{Name}", Summary = "Hello Text Service")] [Route("/abc/{Name}", Summary = "ABC Text Service")] public class HelloText { [ApiMember(Name = "Name", Description = "Name Description", ParameterType = "path", DataType = "string", IsRequired = true)] public string Name { get; set; } }
Go to local swagger-page (localhost:yourport/swagger-ui.html) or to resouces page (localhost:yourport/resources) and you'll see that "/abc/" route is captured and "/hellotext" is not
/resource/abc
/resource/helloimage
/resource/hello