Search in sources :

Example 1 with Location

use of com.reprezen.swagedit.core.model.Location in project KaiZen-OpenAPI-Editor by RepreZen.

the class JsonReferenceValidator method createReferenceError.

protected SwaggerError createReferenceError(int severity, String message, AbstractNode source) {
    int line = 1;
    if (source != null) {
        AbstractNode ref = referenceFactory.getReferenceValue(source);
        if (ref != null) {
            Location location = ref != null ? ref.getStart() : source.getStart();
            line = location.getLine() + 1;
        }
    }
    return new SwaggerError(line, severity, message);
}
Also used : SwaggerError(com.reprezen.swagedit.core.validation.SwaggerError) AbstractNode(com.reprezen.swagedit.core.model.AbstractNode) Location(com.reprezen.swagedit.core.model.Location)

Aggregations

AbstractNode (com.reprezen.swagedit.core.model.AbstractNode)1 Location (com.reprezen.swagedit.core.model.Location)1 SwaggerError (com.reprezen.swagedit.core.validation.SwaggerError)1