-
Notifications
You must be signed in to change notification settings - Fork 121
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
Fix a bug where a JSON file cannot be watched and fetched as String #511
Conversation
Motivation: A user might want to watch and fetch a JSON file as String. Currently, it's not possible. Modifications: - Add `contetType` to `Query` which indicates the type of the file being queried. - Remove JSON related annotations in `Query` and its subclases. - `Query` is not directly (de)serialized into JSON. - Remove `QueryDto` and `NamedQueryDto` which are not used. Result: - You can now fetch and watch a JSON as String.
Codecov Report
@@ Coverage Diff @@
## master #511 +/- ##
============================================
+ Coverage 69.58% 69.74% +0.16%
- Complexity 3152 3168 +16
============================================
Files 327 325 -2
Lines 12755 12747 -8
Branches 1356 1362 +6
============================================
+ Hits 8875 8891 +16
+ Misses 3021 2994 -27
- Partials 859 862 +3 Continue to review full report at Codecov.
|
common/src/main/java/com/linecorp/centraldogma/common/QueryType.java
Outdated
Show resolved
Hide resolved
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.
Thanks! @minwoox
@@ -894,7 +897,7 @@ private static Revision watchRepository(AggregatedHttpResponse res) { | |||
return client.execute(builder.build()).aggregate() | |||
.handle((res, cause) -> { | |||
if (cause == null) { | |||
return func.apply(res); | |||
return func.apply(res, queryType); | |||
} | |||
|
|||
if ((cause instanceof ClosedSessionException || |
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.
nit: Could remove ClosedSessionException
(not related to this PR 😉)
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.
Ah fixed. Thanks! 😄
Motivation:
A user might want to watch and fetch a JSON file as String. Currently, it's not possible.
Modifications:
IDENTITY_TEXT
andIDENTITY_JSON
toQueryType
.Query
and its subclasses.Query
is not directly (de)serialized into JSON.QueryDto
andNamedQueryDto
which are not used.Result: