import org.onap.crud.exception.CrudException;
import org.onap.crud.logging.CrudServiceMsgs;
import org.onap.crud.logging.LoggingUtil;
+import org.onap.crud.parser.BulkPayload;
+import org.onap.crud.parser.EdgePayload;
+import org.onap.crud.parser.VertexPayload;
import org.onap.crud.util.CrudProperties;
import org.onap.crud.util.CrudServiceConstants;
import org.onap.crud.util.CrudServiceUtil;
EdgePayload edgePayload = EdgePayload.fromJson(item.getValue().getAsJsonObject().toString());
- if (edgePayload.getType() == null) {
- throw new CrudException("Edge Type cannot be null for: " + item.getKey(), Status.BAD_REQUEST);
- }
-
if (!opr.getKey().equalsIgnoreCase("operation")) {
throw new CrudException("operation missing in item: " + item.getKey(), Status.BAD_REQUEST);
}
}
if (payload.getType() == null || payload.getType().isEmpty()) {
- throw new CrudException("Missing Edge Type ", Status.BAD_REQUEST);
+ payload.setType(CrudServiceUtil.determineEdgeType(payload, version));
}
+
ImmutablePair<EntityTag, String> result = graphDataService.addEdge(version, payload.getType(), payload);
response = Response.status(Status.CREATED).entity(result.getValue()).tag(result.getKey()).type(mediaType).build();
} else {