-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Resteasy Reactive: Support use of optional with list/set/sortedset #24055
Conversation
Moving to Draft as this is not fully working yet. |
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!
02dc081
to
6e22f6e
Compare
Now, the PR is ready to be reviewed. There is a controversial difference of behaviors here between Resteasy Reactive and Resteasy Classic. Let's imagine we have the following endpoint: @Path("/list")
@GET
public String sayHelloToList(@QueryParam("name") final Optional<List<String>> names) {
// ...
} If no query params are being set, I would expect to receive an optional empty. This is working like this in Resteasy Reactive, but in Resteasy Classic, you'll receive the optional with an empty list of strings. |
I think the way we have it now is fine, I wouldn't worry too much about maintaining compatibility on this particular point |
This workflow status is outdated as a new workflow run has been triggered. Failing Jobs - Building 6e22f6e
Failures⚙️ Initial JDK 11 Build #- Failing: extensions/resteasy-classic/resteasy/deployment
! Skipped: devtools/bom-descriptor-json docs extensions/agroal/deployment and 309 more 📦 extensions/resteasy-classic/resteasy/deployment✖ |
Support use when using query params with some collections. Example: ```java @path("/list") @get public String sayHelloToList(@QueryParam("name") final Optional<List<String>> names) { return doSayHelloToCollection(names); } ``` fix quarkusio#23898
6e22f6e
to
9dd7f7b
Compare
Object converted = delegate.convert(parameter); | ||
if (converted != null | ||
&& converted instanceof Collection | ||
&& ((Collection) converted).isEmpty()) { |
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.
Is it really necessary to check if the collection is Empty ?
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.
To return optional empty when the collection is empty, yes. See my comment here: #24055 (comment)
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.
Oh I see, you are right, It's better this way
Failing Jobs - Building 9dd7f7b
Full information is available in the Build summary check run. Failures⚙️ JVM Tests - JDK 11 #- Failing: integration-tests/reactive-messaging-kafka
📦 integration-tests/reactive-messaging-kafka✖
|
Should we support |
As far I could see, the rest client reactive extension already supports it. |
Support use when using query params with some collections. Example:
fix #23898