I have an endpoint that takes a custom type (in this particular case a NodaTime.LocalDate). The type has a custom model binder and is mapped in Swagger using MapType<>
.
When the type is used in the route as a path parameter, the endpoint doesn't show up in Swagger/Swashbuckle. However, if I remove it (so that it's included as a URL parameter instead), it shows just fine.
A simple version of the endpoint:
public class MyController : System.Web.Http.ApiController
{
[Route( "my/route/{date}" )] // Doesn't show up
[Route( "my/route" )] // Does show up
[HttpPut]
public Task<IHttpActionResult> MyEndpoint( LocalDate date, InputModel inputModel ) {
// Do stuff...
}
}
Note that both endpoints actually work, one just doesn't show up. I can also get the both endpoints to show up, if I change the type to DateTime
- but I don't want that, since that would change the valid input set.