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

_errorsAsMap method is not implemented to handle collection #306

Open
shivangipandey opened this issue Dec 9, 2024 · 0 comments
Open

_errorsAsMap method is not implemented to handle collection #306

shivangipandey opened this issue Dec 9, 2024 · 0 comments

Comments

@shivangipandey
Copy link

shivangipandey commented Dec 9, 2024

for 'AbstractGraphQlModel' -> _errorsAsMap method is not implemented to handle collection :

if (o instanceof AbstractGraphQlModel<?> graphQlModel) {
    Map<String, Object> errorsAsMap = graphQlModel._errorsAsMap();
    if (!errorsAsMap.isEmpty()) {
        if (map == null) {
            map = new LinkedHashMap();
        }
        map.put(s, errorsAsMap);
    }
}

Should be implemented as below :

dataModel._values().forEach((key, value) -> {
  if (value instanceof Collection<?> collection) {
    processCollectionErrors(errorMap, key, collection);
  } else if (value instanceof AbstractGraphQlModel<?> nestedModel) {
    processModelErrors(errorMap, key, nestedModel);
  }
});
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

No branches or pull requests

1 participant