Search in sources :

Example 1 with OperationFinder

use of io.apicurio.datamodels.core.visitors.OperationFinder in project apicurio-data-models by Apicurio.

the class OasInvalidLinkOperationIdRule method visitLink.

/**
 * @see io.apicurio.datamodels.combined.visitors.CombinedAllNodeVisitor#visitLink(io.apicurio.datamodels.openapi.v3.models.Oas30Link)
 */
@Override
public void visitLink(Oas30Link node) {
    if (hasValue(node.operationId)) {
        OperationFinder finder = new OperationFinder(node.operationId);
        VisitorUtil.visitTree(node.ownerDocument(), finder, TraverserDirection.down);
        this.reportIfInvalid(finder.isFound(), node, Constants.PROP_OPERATION_ID, map());
    }
}
Also used : OperationFinder(io.apicurio.datamodels.core.visitors.OperationFinder)

Example 2 with OperationFinder

use of io.apicurio.datamodels.core.visitors.OperationFinder in project apicurio-data-models by Apicurio.

the class OasUnmatchedExampleTypeRule method findParentOperation.

/**
 * Finds the parent operation for the given node.
 * @param example
 */
private static Operation findParentOperation(Node node) {
    OperationFinder finder = new OperationFinder();
    VisitorUtil.visitTree(node, finder, TraverserDirection.up);
    return finder.found;
}
Also used : OperationFinder(io.apicurio.datamodels.core.visitors.OperationFinder)

Example 3 with OperationFinder

use of io.apicurio.datamodels.core.visitors.OperationFinder in project apicurio-data-models by Apicurio.

the class Oas20to30TransformationVisitor method findParentOperation.

private Oas20Operation findParentOperation(Parameter node) {
    OperationFinder finder = new OperationFinder();
    Library.visitTree(node, finder, TraverserDirection.up);
    return (Oas20Operation) finder.found;
}
Also used : OperationFinder(io.apicurio.datamodels.core.visitors.OperationFinder) Oas20Operation(io.apicurio.datamodels.openapi.v2.models.Oas20Operation)

Aggregations

OperationFinder (io.apicurio.datamodels.core.visitors.OperationFinder)3 Oas20Operation (io.apicurio.datamodels.openapi.v2.models.Oas20Operation)1