Skip to content

payload validation causes large amount of allocations #386

Description

@SoMuchForSubtlety

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)));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions