Minimal APIs route constraints break OpenAPI requests #36413
Labels
area-minimal
Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc
feature-minimal-actions
Controller-like actions for endpoint routing
old-area-web-frameworks-do-not-use
*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels
Priority:1
Work that is critical for the release, but we could probably ship without
Milestone
Describe the bug
If a Minimal API endpoint uses a route constraint, for example
"/status/{code:range(200, 599)}"
, the constraint is exposed to OpenAPI documentation incorrectly, which causes the API to be called incorrectly, resulting in an HTTP 404.https://localhost:7168/status/%7Bcode:range(200,%20599)%7D
To Reproduce
Create an empty ASP.NET Core 6 project with a reference to
Swashbuckle.AspNetCore
with the below code asProgram.cs
.Further technical details
.NET SDK version
6.0.100-rc.1.21460.8
The text was updated successfully, but these errors were encountered: