Skip to content

Route constraints doesn't work in minimal Web API #37109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Marusyk opened this issue Sep 29, 2021 · 2 comments
Closed

Route constraints doesn't work in minimal Web API #37109

Marusyk opened this issue Sep 29, 2021 · 2 comments
Labels
✔️ Resolution: Duplicate Resolved as a duplicate of another issue old-area-web-frameworks-do-not-use *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels Status: Resolved

Comments

@Marusyk
Copy link
Member

Marusyk commented Sep 29, 2021

Describe the bug

Route constraints doesn't work in minimal Web API

The following endpoint returns 404

app.MapGet("/hello/{param:alpha}", (string param) => new { Hello = param });

image

Further technical details

  • ASP.NET Core 6
  • dotnet version: 6.0.100-preview.7.21379.14
  • Microsoft Visual Studio Community 2022 Preview (64-bit)
    Version 17.0.0 Preview 3.1
@Marusyk Marusyk changed the title Route constraint doesn't work in minimal Web API Route constraints doesn't work in minimal Web API Sep 29, 2021
@mkArtakMSFT mkArtakMSFT added the old-area-web-frameworks-do-not-use *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels label Sep 29, 2021
@martincostello
Copy link
Member

Possible duplicate of #36413

@BrennanConroy
Copy link
Member

Like Martin said, this has been fixed in swashbuckle 6.2.2 and we have some followup work to make it properly constrain the type on the UI end #36525

@BrennanConroy BrennanConroy added the ✔️ Resolution: Duplicate Resolved as a duplicate of another issue label Sep 30, 2021
@ghost ghost added the Status: Resolved label Sep 30, 2021
@Marusyk Marusyk closed this as completed Sep 30, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Nov 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
✔️ Resolution: Duplicate Resolved as a duplicate of another issue old-area-web-frameworks-do-not-use *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels Status: Resolved
Projects
None yet
Development

No branches or pull requests

4 participants