-
Notifications
You must be signed in to change notification settings - Fork 10.3k
"dotnet new webapiaot" should include OpenAPI support #59564
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
Comments
If we're going to implement this, we should also update the docs that currently mention you need to add the package yourself: |
@sander1095 Thanks for filing this issue! I had mentally flagged adding in OpenAPI support to the Web API AoT template in .NET 9 but didn't do the legwork on filing an issue/doing the work. I'm happy to do this in .NET 10. One thing to note is that we're currently in the process of updating to the next major version of the OpenAPI.NET library to support OpenAPI 3.1 which regressed its AoT support. We'll want to close the loop on that before updating the templates for .NET 10. |
So you're saying you'll be implementing it? I would also like to do it, as mentioned in the description. :) If you'd also welcome a community contribution - after AOT support is brought back - tag me and I'll get started on it? :) |
Community contribution definitely welcome! I'll post on this issue once AoT support is back again and we can update the templates. |
I've heard from Safia that this issue can now be worked on. I'm working on this now :) |
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
When I try to create an ASP.NET Core project with AOT support, I can use
dotnet new webapiaot
. I can add the--help
flag to see available options:That's quite limited!
I can also create a project without AOT support by using
dotnet new webapi
. This has a lot more options:Click to view code
The problem is that the AOT template doesn't have OpenAPI support by default, while the non-AOT version does support OpenAPI by default.
This is understandable, as .NET 8 didn't contain an AOT compatible OpenAPI implementation. However, NET 9 received improved OpenAPI support with AOT support: https://devblogs.microsoft.com/dotnet/dotnet9-openapi/.
This is not included by default in the .NET 9
webapiaot
template, nor is it a flag like it is fordotnet new webapi
(--no-openapi
).I understand there are a smaller amount of supported flags as AOT support is quite new, but I would like to see it added.
Describe the solution you'd like
OpenAPI is important for complex API's or API's that are consumed by API clients, like front-ends or other API's. If it is supported for non-aot projects, I would like to see it supported for AOT projects, too!
Additional context
I wouldn't mind creating a PR myself if the team agrees this could be useful!
The text was updated successfully, but these errors were encountered: