Swashbuckle.AspNetCore
Swashbuckle.AspNetCore copied to clipboard
`Bind(Prefix = "someprefix")` ignored on query parameter of complex type
Hi,
I have the following complex type which I would like to bind to as a query parameter. According to the ASP.NET docs complex types get flattened, however if I understand the documentation correctly using [Bind(Prefix = "someprefix")]
should allow me to force a someprefix.
prefix.
My code:
public class DateTimeRange
{
public DateTime? Start { get; set; }
public DateTime? End { get; set; }
}
In my controller:
[HttpGet]
public ActionResult MyMethod(
[Bind(Prefix = "someprefix")]
[FromQuery]
DateTimeRange? created)
{
return Ok();
}
Results in the following swagger def:
Is there a way to get it to set the parameter names to created.start
and created.end
instead of just plain start
and end
.