Skip to content

Commit

Permalink
Add api.ror.org as supported API
Browse files Browse the repository at this point in the history
  • Loading branch information
tkuhn committed Feb 15, 2024
1 parent e27c7d4 commit 1c5af93
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main/java/com/knowledgepixels/nanodash/LookupApis.java
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,17 @@ public static void getPossibleValues(String apiString, String searchterm, Map<St
labelMap.put(uri, label);
}
}
} else if (apiString.startsWith("https://api.ror.org/organizations")) {
// TODO This is just a test and needs to be improved
JSONArray responseArray = new JSONObject(respString).getJSONArray("items");
for (int i = 0; i < responseArray.length(); i++) {
String uri = responseArray.getJSONObject(i).getString("id");
String label = responseArray.getJSONObject(i).getString("name");
if (!values.contains(uri)) {
values.add(uri);
labelMap.put(uri, label);
}
}
} else {
// TODO: create parseJsonApi() ?
boolean foundId = false;
Expand Down

0 comments on commit 1c5af93

Please sign in to comment.