You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
When sending an invalid enum value the error is not as expected #2560
Describe the bug
When an invalid enum-value is send-in the error results in a weird chain of invalid value. Like this:
{
"errors" : [ {
"message" : "invalid value : invalid value : invalid value : Invalid input for Enum 'PositionType'. No value found for name 'UNKNOWN_POSITION'",
"extensions" : {
"classification" : "ValidationError"
}
} ]
}
This is caused by the change related to default-values and a change in the ValuesResolver.java
Each type in the tree will add a invalid value : to the error message. So if you have a depth of 3 it will be three invalid values.
Another issue is that you don't know which field is actually invalid. The previous version of the code had the name of the field in the error message, which was way more convenient.
Previous message was: Variable 'position' has an invalid value: ...
I also encounter this for other types as well, same for sending "maybe" to a Boolean type. So probably other types will have the same issue as well?
I just found this issue during our upgrade from 15.0 to 17.3. Some of our tests started failing during the deserialization of a bad UUID (0000-0000) for a custom non-null scalar variable.
Thanks for the fix, it looks good. How likely is it that there is going to be release 17.4?
Activity
dondonz commentedon Oct 8, 2021
Thanks @haneev! The fix has been merged in.
The error message will now appear as
haneev commentedon Oct 15, 2021
Thanks @dondonz! Looking good! I will close the issue as resolved :)
juriad commentedon Nov 3, 2021
I just found this issue during our upgrade from 15.0 to 17.3. Some of our tests started failing during the deserialization of a bad UUID (0000-0000) for a custom non-null scalar variable.
Thanks for the fix, it looks good. How likely is it that there is going to be release 17.4?