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

New rule S6968 for C#: Actions that return a value should be annotated with ProducesResponseTypeAttribute containing the return type #9185

Merged
merged 17 commits into from
Apr 24, 2024

Conversation

costin-zaharia-sonarsource
Copy link
Member

Fixes #9093

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good work, but we need to consider some more cases.
Mostly this is on me, as I did not add "negative" tests that should be compliant during spec😞

To sum it up:

  • Invocations should be inside return statements
  • Some ControllerBase overloads need to be excluded
  • SwaggerResponse at controller level.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

auto-merge was automatically disabled April 24, 2024 14:57

Pull Request is not mergeable

Copy link

sonarcloud bot commented Apr 24, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link

sonarcloud bot commented Apr 24, 2024

@costin-zaharia-sonarsource costin-zaharia-sonarsource merged commit c83dc72 into master Apr 24, 2024
25 checks passed
@costin-zaharia-sonarsource costin-zaharia-sonarsource deleted the costin/rule-S6968 branch April 24, 2024 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants