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

Fix S6964 FN: Rule should raise in case of value type property annotated with RequiredAttribute #9313

Merged
merged 5 commits into from
May 27, 2024

Conversation

mary-georgiou-sonarsource
Copy link
Contributor

Fixes #9263

RSPEC PR: SonarSource/rspec#3942

@mary-georgiou-sonarsource mary-georgiou-sonarsource changed the title Rule S6964 FN: rule should raise in case of value type property annotated with RequiredAttribute Fix S6964 FN: rule should raise in case of value type property annotated with RequiredAttribute May 22, 2024
@mary-georgiou-sonarsource
Copy link
Contributor Author

@zsolt-kolbay-sonarsource - I haven't updated the ITs yet - I prefer to get the first round of review since, for example, the message or what we raise might change.
Once we are ok with these I'll update the ITs once and add some more cases as well.

Copy link
Contributor

@zsolt-kolbay-sonarsource zsolt-kolbay-sonarsource left a comment

Choose a reason for hiding this comment

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

LGTM. Left one comment on the RSPEC PR that should addressed before merging this PR.

@@ -1,6 +1,7 @@
using Microsoft.AspNetCore.Mvc;
using System;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
Copy link
Contributor

Choose a reason for hiding this comment

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

Now that we know that [Required] doesn't affect value properties, please change this comment to:

// Compliant - the JSON serializer will throw an exception if the value is missing from the request

@mary-georgiou-sonarsource mary-georgiou-sonarsource changed the title Fix S6964 FN: rule should raise in case of value type property annotated with RequiredAttribute Fix S6964 FN: Rule should raise in case of value type property annotated with RequiredAttribute May 27, 2024
@mary-georgiou-sonarsource mary-georgiou-sonarsource force-pushed the mary/S6964-last branch 2 times, most recently from 74c4793 to 68adace Compare May 27, 2024 13:45
Copy link

sonarcloud bot commented May 27, 2024

Quality Gate Passed Quality Gate passed for 'Sonar .NET Java Plugin'

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 May 27, 2024

@mary-georgiou-sonarsource mary-georgiou-sonarsource merged commit e3a08cf into master May 27, 2024
26 checks passed
@mary-georgiou-sonarsource mary-georgiou-sonarsource deleted the mary/S6964-last branch May 27, 2024 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix S6964 FN: Rule should raise in case of value type property annotated with RequiredAttribute
2 participants