Skip to content

Commit 562d643

Browse files
Merge pull request #241 from CodeForPhilly/feat/call-older-library-api-versions
Dynamically call library api versions
2 parents a5d6857 + 706650a commit 562d643

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

builder-api/src/main/java/org/acme/service/LibraryApiService.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,10 @@ public EvaluationResult evaluateCheck(CheckConfig checkConfig, Map<String, Objec
8787
String bodyJson = mapper.writeValueAsString(data);
8888

8989
HttpClient client = HttpClient.newHttpClient();
90-
90+
String urlEncodedVersion = checkConfig.getCheckVersion().replace('.', '-');
91+
String baseUrl = String.format("https://library-api-v%s---library-api-cnsoqyluna-uc.a.run.app", urlEncodedVersion);
9192
HttpRequest request = HttpRequest.newBuilder()
92-
.uri(URI.create("https://library-api-cnsoqyluna-uc.a.run.app" + checkConfig.getEvaluationUrl()))
93+
.uri(URI.create(baseUrl + checkConfig.getEvaluationUrl()))
9394
.header("Content-Type", "application/json")
9495
.POST(HttpRequest.BodyPublishers.ofString(bodyJson))
9596
.build();

0 commit comments

Comments
 (0)