Skip to content

Commit

Permalink
extend test and fix api metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
denis-yuen committed Jan 25, 2024
1 parent c83bf00 commit 13e39d0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/main/java/io/dockstore/EntryCreatorExample.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,24 @@ public static void main(String[] args) throws ApiException, IOException {

String conceptDoiUrl = publishedDeposit.getLinks().get("parent_doi");

System.out.println("Success creating concept DOI");
System.out.println(conceptDoiUrl);
System.out.println("Success creating first deposit");
System.out.println(publishedDeposit);

// test out second deposit
testSecondDeposit(depositApi, actionsApi, publishedDeposit.getId());
}

public static void testSecondDeposit(DepositsApi depositApi, ActionsApi actionsApi, int depositID) {
Deposit returnDeposit = actionsApi.newDepositVersion(depositID);
String depositURL = returnDeposit.getLinks().get("latest_draft");
String depositionIDStr = depositURL.substring(depositURL.lastIndexOf("/") + 1).trim();
int depositionID = Integer.parseInt(depositionIDStr);
returnDeposit = depositApi.getDeposit(depositionID);
DepositMetadata depositMetadata = returnDeposit.getMetadata();
String doi = depositMetadata.getPrereserveDoi().getDoi();
System.out.println("Success creating second deposit");
System.out.println(doi);
}
}
8 changes: 8 additions & 0 deletions src/main/resources/zenodo-1.0.0-swagger-2.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,7 @@ definitions:
type: string
prereserve_doi:
type: object
$ref: '#/definitions/PrereserveDoi'
keywords:
type: array
items:
Expand Down Expand Up @@ -726,6 +727,13 @@ definitions:
- creators
- description
- access_right
PrereserveDoi:
type: object
properties:
doi:
type: string
recid:
type: integer
Subject:
type: object
properties:
Expand Down

0 comments on commit 13e39d0

Please sign in to comment.