Skip to content
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

Mvc.Api.Analyzers not recognizing methods from a Base Class #4410

Open
Tracked by #27889
prmces opened this issue Dec 5, 2018 · 7 comments
Open
Tracked by #27889

Mvc.Api.Analyzers not recognizing methods from a Base Class #4410

prmces opened this issue Dec 5, 2018 · 7 comments
Labels
affected-very-few This issue impacts very few customers analyzer Indicates an issue which is related to analyzer experience area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-openapi Priority:3 Work that is nice to have severity-major This label is used by an internal tool
Milestone

Comments

@prmces
Copy link

prmces commented Dec 5, 2018

My app use a Base Controller to reuse some methods inside my Api controllers.
image

The MVC.API.Analyzer library is looking at my controllers that inherit from this base controller, trying to found undocumented reponse codes. That is correct.

But, inside my Base Controller, I have undocument methods. The swagger UI shows me correctly all the inherited methods, but the analyzers could not point me that I am missing something.

The Controller that inherits from BaseController and its swagger doc. Correct.
image

image

The Base Controller. Wrong. (Im missing documentation for NotFound and BadRequest)
image

Any help on that??

@pranavkm pranavkm added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Dec 5, 2018
@prmces prmces changed the title Mvc.Api.Analyzers not recognizing inherited methods Mvc.Api.Analyzers not recognizing methods from a Base Class Dec 5, 2018
@mkArtakMSFT
Copy link
Member

Thanks for contacting us, @prmces.
@pranavkm, please look into this when you'll be back. Thanks!

@mkArtakMSFT mkArtakMSFT added enhancement This issue represents an ask for new feature or an enhancement to an existing one 1 - Ready and removed investigate labels Dec 6, 2018
@mkArtakMSFT mkArtakMSFT added this to the 3.0.0-preview3 milestone Dec 6, 2018
@pranavkm
Copy link
Contributor

pranavkm commented Dec 7, 2018

The analyzer uses the same behavior as runtime to determine if something's a controller. For instance, generic types or abstract types aren't considered controllers. While this is true at runtime, it clearly doesn't work very well for inherited types like yours. We should consider relaxing this restriction.

@topres
Copy link

topres commented Jan 4, 2019

Just to add a note to this @mkArtakMSFT

The same issue occurs when using local functions or Func in the controller action. Would be nice if the analyzer check was recursive in the controller action path.

@mkArtakMSFT mkArtakMSFT modified the milestones: 3.0.0-preview6, Backlog Apr 19, 2019
@captainsafia captainsafia added affected-very-few This issue impacts very few customers severity-major This label is used by an internal tool labels Nov 12, 2020
@mkArtakMSFT mkArtakMSFT modified the milestones: Backlog, 6.0-preview4 Mar 19, 2021
@javiercn javiercn added analyzer Indicates an issue which is related to analyzer experience feature-openapi labels Apr 18, 2021
@ghost
Copy link

ghost commented Apr 20, 2021

Thanks for contacting us.
We're moving this issue to the Next sprint planning milestone for future evaluation / consideration. Because it's not immediately obvious that this is a bug in our framework, we would like to keep this around to collect more feedback, which can later help us determine the impact of it. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@ghost
Copy link

ghost commented Jul 13, 2021

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@pranavkm pranavkm added old-area-web-frameworks-do-not-use *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels and removed area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates labels Oct 19, 2021
@ghost
Copy link

ghost commented Dec 28, 2021

Thanks for contacting us.

We're moving this issue to the .NET 7 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@ghost
Copy link

ghost commented Oct 11, 2022

Thanks for contacting us.

We're moving this issue to the .NET 8 Planning milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@javiercn javiercn removed their assignment Oct 19, 2022
@captainsafia captainsafia added area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates and removed old-area-web-frameworks-do-not-use *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels labels Jun 20, 2023
@captainsafia captainsafia modified the milestones: .NET 8 Planning, Backlog Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affected-very-few This issue impacts very few customers analyzer Indicates an issue which is related to analyzer experience area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-openapi Priority:3 Work that is nice to have severity-major This label is used by an internal tool
Projects
None yet
Development

No branches or pull requests

7 participants