Search in sources :

Example 1 with Severity

use of io.swagger.report.Severity in project swagger-parser by swagger-api.

the class SwaggerJsonValidator method fillMessages.

private static boolean fillMessages(final ProcessingReport report, final MessageBuilder builder) {
    final Severity severity = LEVEL_MAP.get(report.getLogLevel());
    final ArrayNode node = JacksonUtils.nodeFactory().arrayNode();
    for (final ProcessingMessage processingMessage : report) {
        node.add(processingMessage.asJson());
    }
    final String reportAsString = JacksonUtils.prettyPrint(node);
    final Message message = new Message("", reportAsString, severity);
    builder.append(message);
    return report.isSuccess();
}
Also used : ProcessingMessage(com.github.fge.jsonschema.core.report.ProcessingMessage) Message(io.swagger.report.Message) ProcessingMessage(com.github.fge.jsonschema.core.report.ProcessingMessage) Severity(io.swagger.report.Severity) ArrayNode(com.fasterxml.jackson.databind.node.ArrayNode)

Aggregations

ArrayNode (com.fasterxml.jackson.databind.node.ArrayNode)1 ProcessingMessage (com.github.fge.jsonschema.core.report.ProcessingMessage)1 Message (io.swagger.report.Message)1 Severity (io.swagger.report.Severity)1