-
Notifications
You must be signed in to change notification settings - Fork 362
[spring-server] fix: Exclude stacktraces when null values are specified for non-null parameters #426
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #426 +/- ##
============================================
+ Coverage 97.8% 97.81% +0.01%
Complexity 325 325
============================================
Files 105 105
Lines 1230 1236 +6
Branches 202 204 +2
============================================
+ Hits 1203 1209 +6
Misses 7 7
Partials 20 20
Continue to review full report at Codecov.
|
...otlin-spring-server/src/main/kotlin/com/expediagroup/graphql/spring/model/GraphQLResponse.kt
Outdated
Show resolved
Hide resolved
...otlin-spring-server/src/main/kotlin/com/expediagroup/graphql/spring/model/GraphQLResponse.kt
Show resolved
Hide resolved
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.
Can we add unit tests to verify the new behaviour? This should be relatively easy since this is an extension function
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.
Actually can we add one more test case for the default behavior
@smyrick I think we do have one already for the default behavior - https://github.com/ExpediaGroup/graphql-kotlin/blob/master/graphql-kotlin-spring-server/src/test/kotlin/com/expediagroup/graphql/spring/model/GraphQLResponseKtTest.kt#L75 |
📝 Description
Refer #423 (comment) for the cause
The fix includes setting
stackTrace
to an empty array when the error type is aValidationError
and aNonNullableValueCoercedAsNullException
was thrown🔗 Related Issues
Resolves #423