use of com.reprezen.swagedit.core.schema.MultipleTypeDefinition in project KaiZen-OpenAPI-Editor by RepreZen.
the class ComponentContextType method isReference.
protected boolean isReference(Model model, JsonPointer pointer) {
AbstractNode contextNode = model.find(pointer);
if (contextNode == null) {
return false;
}
TypeDefinition type = contextNode.getType();
if (type instanceof MultipleTypeDefinition) {
// MultipleTypeDefinition is a special case, it happens when several properties match a property
for (TypeDefinition nestedType : ((MultipleTypeDefinition) type).getMultipleTypes()) {
if (getReferencePointerString().equals(nestedType.getPointer().toString())) {
return true;
}
}
}
JsonPointer pointerToType = type.getPointer();
if (pointerToType == null) {
return false;
}
return getReferencePointerString().equals(pointerToType.toString());
}
Aggregations