-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Add Microsoft.AspNetCore.OpenApi to the webapiaot template (with an optional flag to disable it) #60337
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
Add Microsoft.AspNetCore.OpenApi to the webapiaot template (with an optional flag to disable it) #60337
Conversation
This PR still has the following issues:
I'd love some help/instructions with the issues mentioned above! If someone could verify the package works, that'd be great.. |
src/ProjectTemplates/Web.ProjectTemplates/content/WebApiAot-CSharp/Program.cs
Outdated
Show resolved
Hide resolved
....ProjectTemplates/content/WebApiAot-CSharp/.template.config/localize/templatestrings.cs.json
Outdated
Show resolved
Hide resolved
src/ProjectTemplates/Web.ProjectTemplates/content/WebApiAot-CSharp/Program.Main.cs
Outdated
Show resolved
Hide resolved
src/ProjectTemplates/Web.ProjectTemplates/content/WebApiAot-CSharp/Program.Main.cs
Outdated
Show resolved
Hide resolved
…ration Release`. I assume this is part of the natural process of creating a PR and thus should be committed.
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
@sander1095 This looks good to me overall! I'd like to get @DamianEdwards thoughts on this since he's got more experience with making template changes and might have thoughts on other things we need to do here. He's OOF right now so we might have to wait a while for his feedback. |
@DamianEdwards can you schedule time for review? |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
Hi @DamianEdwards ! Thanks for approving this PR. Safia said:
Like I said in my comments in this PR, I can not get the tests to run correctly, nor can I create a project to test my changes locally. Are you able to help out with this? |
@sander1095 Absent running tests locally, we can rely on test failiures in CI to diagnose issues. Based on the build analysis, it seems like the templates are currently unbuildable because the correct usings for the TypedResult static methods are not in place. |
Head branch was pushed to by a user without write access
Apologies, I didn't know there was such a handy UI with the explicit errors. I've researched this, and I found that This means we need to make a choice:
I'd prefer option 2 so we can keep the What do you think, @captainsafia ? If you also agree with option 2, I can remove the draft status of the PR in the SDK repo |
I think for this case, we can stick to explicit usings in the Program.cs for this templates. Modifying the global usings is a more global (heh) change to be mindful and it's harder to take back once we've done it compared to a local change in a single template. |
…sts fail" This reverts commit 63cf302.
…apps, which is not the case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! TY for adding tests and resolving all the details.
I kicked CI -- looked like a flake.
Add Microsoft.AspNetCore.OpenApi to the webapiaot template (with an optional flag to disable it)
Creates feature parity with the webapi template in regards to OpenAPI
Description
This PR adds
Microsoft.AspNetCore.OpenApi
to thedotnet new webapiaot
template as .NET 9 made that package AOT compatible. Just like thewebapi
template, OpenAPI support is included by default and it now also contains a--no-openapi
flag to disable OpenAPI if desired.Fixes #59564