-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
api: allow urlencoded path parameters, java client: properly urlencode path parameters #1419
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1419 +/- ##
============================================
- Coverage 79.80% 79.73% -0.08%
- Complexity 916 922 +6
============================================
Files 197 197
Lines 5759 5778 +19
Branches 393 397 +4
============================================
+ Hits 4596 4607 +11
- Misses 744 747 +3
- Partials 419 424 +5
Continue to review full report at Codecov.
|
clients/java/src/main/java/marquez/client/MarquezWriteOnlyClientImpl.java
Outdated
Show resolved
Hide resolved
clients/java/src/test/java/marquez/client/MarquezWriteOnlyClientTest.java
Outdated
Show resolved
Hide resolved
@@ -89,7 +88,7 @@ public void testCreateRunWithId() { | |||
RunMeta runMeta = RunMeta.builder().id(id).build(); | |||
client.createRun("namespaceName", "jobName", runMeta); | |||
verify(backend, times(1)) | |||
.post("/api/v1/namespaces/namespaceName/jobs/jobName/runs", runMeta.toJson()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you think about handling this case also in method?
private URL url(String path) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any idea of something better than
if (baseUrl.toString().endsWith("/") && path.startsWith("/")) {
path = path.substring(1);
} else if (!baseUrl.toString().endsWith("/") && !path.startsWith("/")) {
path = "/" + path;
}
623a293
to
3504d08
Compare
da0ed70
to
628a0c8
Compare
@wslulciuc @OleksandrDvornik can we merge it? |
looks good for me |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mobuchowski, changes look great! I left a comment about reverting some changes related to the paths that are internal. Once reverted, we're good to merge 👍
cd72250
to
4e801ae
Compare
Signed-off-by: Maciej Obuchowski <maciej.obuchowski@getindata.com>
4e801ae
to
0af7a69
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 💯 🥇
Use HttpCompliance.RFC7230_LEGACY to allow potentially ambiguous URIs with encoded path segments.
Refactor Marquez Java client to properly urlencode path segments.