-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Added 'lenient' annotation toggle #1523
Conversation
Codecov Report
@@ Coverage Diff @@
## release/2.x #1523 +/- ##
=================================================
+ Coverage 88.59% 88.59% +<.01%
- Complexity 2401 2402 +1
=================================================
Files 299 299
Lines 6039 6041 +2
Branches 733 734 +1
=================================================
+ Hits 5350 5352 +2
Misses 510 510
Partials 179 179
Continue to review full report at Codecov.
|
@@ -76,4 +76,6 @@ | |||
Class<?>[] extraInterfaces() default {}; | |||
|
|||
boolean serializable() default false; | |||
|
|||
boolean lenient() default false; |
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.
This is a more a general point, but we probably should add mockSettings
here and not have all arguments duplicated in the annotation.
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.
Why do you think so? It is very nice and clean to configure the parameters directly.
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.
Because we duplicate all values from mockSettings
into this annotation. That feels brittle and easy-to-forget.
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.
That's fair.
I don't see what's brittle here - this is public API that we don't change. We can forget to add annotation but... so what... our users will remind us and they can always submit a PR.
It's a rather small trade-off for having a good looking API :)
Thank you for feedback. I'll add documentation and merge it. |
This way we can conveniently configure an existing 'lenient' setting via an annotation. See the unit test that describes the feature.
This way we can conveniently configure an existing 'lenient' setting via an annotation. See the unit test that describes the feature.