-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
WithSummary and WithDescription deson't work in minimal api #45082
Comments
@mehdihadeli This is a dupe of #40753 and is blocked on domaindrivendev/Swashbuckle.AspNetCore#2414 being merged. As an alternative, I'd recommend using the app.MapGet("/api/v{version:apiVersion}/weatherforecast/byid", () => { return new List<string>(); }
.WithOpenApi(operation => new(operation)
{
Summary = "Summary",
Description = "Description"
}); |
Hi @mehdihadeli. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
@captainsafia Thanks for your response. app.MapGet("/api/v{version:apiVersion}/weatherforecast/byid", () => { return new List<string>(); }
.WithApiVersionSet("weatherforecast")
.HasApiVersion(1.0)
.WithOpenApi(operation => new(operation)
{
Summary = "Summary",
Description = "Description"
}); |
@mehdihadeli What's the error you get? The |
Hi @mehdihadeli. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
@captainsafia When I put app.MapGet("/api/v{version:apiVersion}/weatherforecast/byid", () => { return new List<string>(); }
.WithApiVersionSet("weatherforecast")
.HasApiVersion(1.0)
.WithOpenApi(operation => new(operation)
{
Summary = "Summary",
Description = "Description"
}); Unhandled exception. System.NotImplementedException: The method or operation is not implemented.
at Microsoft.AspNetCore.Builder.IEndpointConventionBuilder.Finally(Action`1 finallyConvention)
at Microsoft.AspNetCore.Builder.OpenApiEndpointConventionBuilderExtensions.WithOpenApi[TBuilder](TBuilder builder, Func`2 configureOperation)
at Program.<Main>$(String[] args) in C:\Users\MehdiHadeli\Desktop\versoining\Program.cs:line 43 but when I move the app.MapGet("/api/v{version:apiVersion}/weatherforecast/byid", () => { return new List<string>(); }
.WithOpenApi(operation => new(operation)
{
Summary = "Summary",
Description = "Description"
})
.WithApiVersionSet("weatherforecast")
.HasApiVersion(1.0); |
Aha! @commonsensesoftware I think you might have to update the builders in Asp.Versioning to implement the new |
Thanks @captainsafia. @mehdihadeli Which version are you using? |
Thanks for contacting us. We're moving this issue to the |
@commonsensesoftware Hi, |
@mehdihadeli Apologies, I wasn't clear. Yes, ASP.NET Core and .NET 7 have been released. As this is a major version change, there can be breaking changes. The addition of |
@commonsensesoftware Thanks for your response. I'm waiting for fixing this issue in next minor versions of .net 7 :) |
@commonsensesoftware |
Thanks! Closing this issue out now. There's a PR out on Swashbuckle to support the summary and description methods that's waiting on merge and release. Other than that, I think everything is resolved here. |
@captainsafia Thanks |
Hi,
I have a minimal api in .net 7, I used
WithSummary()
andWithDescription()
bur it doesn't generate anything in swagger ui!The text was updated successfully, but these errors were encountered: