-
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
OpenApi won't Contains those Controllers If the Controller not starts with [ApiController] Attribute #58938
Comments
Try to use Update: |
@yangbocheng Thanks for filing this issue! This is a known limitation of the ApiExplorer infrastructure, the intermediary layer in ASP.NET Core that provides information about registered implementors to OpenAPI tools. In this particular case, only controllers that are attributed with Building on top of @jaceks2106's guidance, why are you avoiding the attribution? There maybe other ways to customize the model binding/validation behavior to your desires. |
This issue has been resolved and has not had any activity for 1 day. It will be closed for housekeeping purposes. See our Issue Management Policies for more information. |
Because [ApiController] will auto do things which i don't need. Follow Microsoft->means use the newest openapi-> means add [ApiController] to every controller-> so why not add this attribute to controller default? -> make bugs for multi programs who don't use apicontroller By the way, when I use the old Swagger, i don't need to add this attribute, everything work well. |
Is there an existing issue for this?
Describe the bug
Simply create a newest NET 9 aspnetcore webapi, then add
Microsoft.AspNetCore.OpenApi
andScalar.AspNetCore
. Then add a new Controller without [ApiController], this contoller's actions won't be included in openapi jsonExpected Behavior
Controllers without [ApiController] should be included in openapi json
Steps To Reproduce
No response
Exceptions (if any)
No response
.NET Version
NET 9
Anything else?
No response
The text was updated successfully, but these errors were encountered: