ASP.NET Core 2.1 Swagger(swashbuckle) Url template optional parameter [duplicate]
问题 This question already has answers here : Optional WebAPI routing parameters with Swagger documentation (1 answer) Make parameters in swashbuckle optional(not required) (3 answers) Swagger: support for optional routes (1 answer) Closed 21 days ago . [HttpGet("commercial/{fromCcy}/{toCcy?}")] public ActionResult Commercial(string fromCcy, string toCcy) I have action "commercial" with optional parameter "toCcy" and swagger spec generates with required field. Is there any way to solve this