Skip to content

Commit

Permalink
Make key configurable when creating a Pid
Browse files Browse the repository at this point in the history
  • Loading branch information
joschrew committed Aug 21, 2023
1 parent 8713915 commit 7ea2cca
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ public class EpicPidService implements PidService {
@Value("${epic.url}")
private String url;

@Value("${epic.pidKey:epic-pid}")
private String pidKey;

private final MutexFactory<String> mutexFactory;

private static final MediaType MEDIA_TYPE_JSON = MediaType.parse("application/json");
Expand Down Expand Up @@ -66,7 +69,7 @@ public String createPid(List<AbstractMap.SimpleImmutableEntry<String, String>> d
// Parse the returned JSON
ObjectMapper mapper = new ObjectMapper();
JsonNode root = mapper.readTree(bodyString);
return root.get("epic-pid").asText();
return root.get(pidKey).asText();
}
}

Expand Down

0 comments on commit 7ea2cca

Please sign in to comment.