Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Provide a way to automatically deserialize non-OK JSON response #5002
Provide a way to automatically deserialize non-OK JSON response #5002
Changes from 1 commit
476442a
30bc8aa
f6c8c80
3182531
a228219
89bd77a
2b9c62c
a800fe9
284d469
e2ac43c
256acf3
8f428cc
532526a
f6e8c4a
2b36e1e
7617569
c6617b8
9abae16
c2c0f48
89b15a2
8be91f8
37b809d
889f5c7
ff99ed6
a434b8c
c944bd3
10e7b45
a6660c8
6f1cf3a
146ba11
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I think we should rename this to
orElseJson
.andThen
is used when both instances are used. However, ifpredicate
returnsfalse
, then it isn't converted.Let me send a patch to rename these methods and address comments.
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.
Please send me your suggestion for these method's name.
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.
Hi, @my4-dev! I made a few changes:
WebClient
. We must not block the inside of the converters.andThenJson
toorElseJson
andThen
is used when both instances are applied. e.g.armeria/core/src/main/java/com/linecorp/armeria/server/logging/AccessLogWriter.java
Lines 79 to 83 in ed16bf6
Predicate
passes and if it passes, the latter one is not applied. So we should rename it toorElse
instead.ConditionalResponseAs
interface because we don't need it at the moment.PTAL and let me know if there are changes that I need to revert. 😉
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.
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.
I wasn't sure how this predicate plays into the current APIs as nothing is public 😅
I'm also curious how the
HttpStatus[Class]Predicate
s tie into the new APIs since. Can you show me an example?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.
I think the same too.
I'm not sure how to use
HttpStatus[Class]Predicate
in the new APIs.It would be unnecessary so that I would remove this class.