@@ -102,22 +102,22 @@ def get_neighbors():
102
102
logging .error ("Repository name is missing in the request." )
103
103
return jsonify ({"status" : "Repository name is required." }), 400
104
104
105
- # Validate 'node_id ' parameter
105
+ # Validate 'node_ids ' parameter
106
106
if not node_ids :
107
- logging .error ("Node ID is missing in the request." )
108
- return jsonify ({"status" : "Node ID is required." }), 400
107
+ logging .error ("Node IDs is missing in the request." )
108
+ return jsonify ({"status" : "Node IDs is required." }), 400
109
109
110
110
# Validate repo exists
111
111
if not graph_exists (repo ):
112
112
logging .error (f"Missing project { repo } " )
113
113
return jsonify ({"status" : f"Missing project { repo } " }), 400
114
114
115
- # Try converting node_id to an integer
115
+ # Try converting node_ids to an integer
116
116
try :
117
117
node_ids = [int (node_id ) for node_id in node_ids ]
118
118
except ValueError :
119
- logging .error (f"Invalid node ID : { node_ids } . It must be an integer." )
120
- return jsonify ({"status" : "Invalid node ID . It must be an integer." }), 400
119
+ logging .error (f"Invalid node IDs : { node_ids } . It must be an integer." )
120
+ return jsonify ({"status" : "Invalid node IDs . It must be an integer." }), 400
121
121
122
122
# Initialize the graph with the provided repository
123
123
g = Graph (repo )
@@ -126,7 +126,7 @@ def get_neighbors():
126
126
neighbors = g .get_neighbors (node_ids )
127
127
128
128
# Log and return the neighbors
129
- logging .info (f"Successfully retrieved neighbors for node ID { node_ids } in repo '{ repo } '." )
129
+ logging .info (f"Successfully retrieved neighbors for node IDs { node_ids } in repo '{ repo } '." )
130
130
131
131
response = {
132
132
'status' : 'success' ,
0 commit comments