Swashbuckle.WebApi
Swashbuckle.WebApi copied to clipboard
Ignore ApiVersion parameter
Hi,
there is a way to ignore the apiversion route parameter? public IActionResult GetBike([FromRoute]ApiVersion apiVersion, [FromRoute] int id, [FromQuery] IncludeOptions<BikeDto, Bike> includeOptions)
Thank you.
The ApiVersion route parameter will already be ignored. Make sure you are using the API versioning API explorer extensions. It appears you are using ASP.NET Core, but this repo is for Web API. The ApiVersion has it's own model binder in both cases. As such, it's source is considered special. It can come from multiple places, even in the same request. You should not attempt to influence it's location by annotating where it comes from; e.g. remove [FromRoute]. The behavior is very similar to how CancellationToken works as a parameter.