I just added swagger to my api to generate some documentation...
normally, my front end code would do a "get by id" like this:
https://whatever.com/api/GetDisplayContainer/A90555CD-931E-4D9D-D51D-08D63E83FCC6
however, swaggers "try it" wants to send:
https://whatever.com/api/GetDisplayContainer?id=A90555CD-931E-4D9D-D51D-08D63E83FCC6
I want to be able to support both ways. How do I do it?
Here is an example of a controller method:
[HttpGet]
[Route("GetDisplayContainer")]
public ApiResponse<ContainerDisplayViewModel> GetDisplayContainer(Guid id)
{
return ApiResponse.Convert(ResourceService, _containerService.GetDisplayContainerById(id));
}
I don't really want to have to change my existing code to do it the "query string" way. because its a totally valid way of doing it. But it would be nice to be able to support both...
This is C# using .net core 2.1.
Thanks!