Skip to content

Commit

Permalink
Merge pull request #11013 from IQSS/11012-get-dataverse-api-ext
Browse files Browse the repository at this point in the history
Extend getDataverse API json payload to include properties isMetadataBlockRoot and isFacetRoot
  • Loading branch information
ofahimIQSS authored Nov 13, 2024
2 parents dc1de87 + 5198a9f commit befc5a9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions doc/release-notes/11012-get-dataverse-api-ext.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The JSON payload of the getDataverse endpoint has been extended to include properties isMetadataBlockRoot and isFacetRoot.
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,9 @@ public static JsonObjectBuilder json(Dataverse dv, Boolean hideEmail, Boolean re
}
bld.add("permissionRoot", dv.isPermissionRoot())
.add("description", dv.getDescription())
.add("dataverseType", dv.getDataverseType().name());
.add("dataverseType", dv.getDataverseType().name())
.add("isMetadataBlockRoot", dv.isMetadataBlockRoot())
.add("isFacetRoot", dv.isFacetRoot());
if (dv.getOwner() != null) {
bld.add("ownerId", dv.getOwner().getId());
}
Expand Down
6 changes: 4 additions & 2 deletions src/test/java/edu/harvard/iq/dataverse/api/DataversesIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,16 @@ public void testDataverseCategory() {
public void testMinimalDataverse() throws FileNotFoundException {
Response createUser = UtilIT.createRandomUser();
createUser.prettyPrint();
String username = UtilIT.getUsernameFromResponse(createUser);
String apiToken = UtilIT.getApiTokenFromResponse(createUser);
JsonObject dvJson;
FileReader reader = new FileReader("doc/sphinx-guides/source/_static/api/dataverse-minimal.json");
dvJson = Json.createReader(reader).readObject();
Response create = UtilIT.createDataverse(dvJson, apiToken);
create.prettyPrint();
create.then().assertThat().statusCode(CREATED.getStatusCode());
create.then().assertThat()
.body("data.isMetadataBlockRoot", equalTo(false))
.body("data.isFacetRoot", equalTo(false))
.statusCode(CREATED.getStatusCode());
Response deleteDataverse = UtilIT.deleteDataverse("science", apiToken);
deleteDataverse.prettyPrint();
deleteDataverse.then().assertThat().statusCode(OK.getStatusCode());
Expand Down

0 comments on commit befc5a9

Please sign in to comment.