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

payload validation causes large amount of allocations #386

Open
SoMuchForSubtlety opened this issue May 21, 2021 · 0 comments
Open

payload validation causes large amount of allocations #386

SoMuchForSubtlety opened this issue May 21, 2021 · 0 comments

Comments

@SoMuchForSubtlety
Copy link

image

The root cause is the generation of lots of warning messages for fields that do not have checkers. (for example the fields example and x-swagger-router-model)
image

This is the relevant bit of code

/*
 * Grab all checkers and object member names. Retain in checkers only
 * existing keywords, and remove from the member names set what is in
 * the checkers' key set: if non empty, some keywords are missing,
 * report them.
 */
final Map<String, SyntaxChecker> map = Maps.newTreeMap();
map.putAll(checkers);


final Set<String> fields = Sets.newHashSet(node.fieldNames());
map.keySet().retainAll(fields);
fields.removeAll(map.keySet());


if (!fields.isEmpty())
    report.warn(newMsg(tree, "core.unknownKeywords")
        .putArgument("ignored", Ordering.natural().sortedCopy(fields)));
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