MyReader () { return (element, object, queue, virtualFile) -> { if (element.isStringLiteral()) { final JsonSchemaType type = parseType(StringUtil.unquoteString(element.getDelegate().getText())); if (type != null) object.setType(type); } else if (element instanceof JsonArrayValueAdapter) { final Set<JsonSchemaType> typeList = ((JsonArrayValueAdapter)element).getElements().stream() .filter(notEmptyString()).map(el -> parseType(StringUtil.unquoteString(el.getDelegate().getText()))) .filter(el -> el != null).collect(Collectors.toSet()); if (!typeList.isEmpty()) object.setTypeVariants(typeList); } }; }