-
Notifications
You must be signed in to change notification settings - Fork 122
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
Clarification about Response.readEntity(XXX) #1001
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Nicolas NESMON (NicoNes) <[email protected]>
@spericas sure you're right a summary will help. Here it is, it is a bit long but I tryied to explain all cases I had in mind:
Please note that contrary to what was written in the original doc Hope it's clearer. Nicolas |
I understand that this PR is in essence a "clarification". However, given its breadth, should we push it into 3.1 at this stage? I suspect that if we write some TCKs for this, some implementations would struggle. I'm generally in favor of merging this, but wanted to bring this to everyone's attention. |
I should be more careful what I ask for ;)
OK.
Looks like these two could be combined, but it's fine. The use of
OK.
So, the last two are essentially one, where the stream is fully or partially consumed.
OK.
These last two appeared repeated from before?
Are these last ones related to buffering at all?
Got it. |
Well I agree with you. At the time I tried with Jersey and Resteasy and they both require some fixes to be fully compliant with the clarification introduced by this PR.
Yes they could be merged in one.
They are almost the same as the ones from the "- getEntity" section.
What I tried to highlight is that if you try to deserialize the underlying input stream into an entity (other than |
@NicoNes I have set the target to 4.0 (tentatively) until I hear from others. As I said above, this is sort of a broad clarification that is probably better for that release. |
Now that working on 4.0 is in progress, we should continue this discussion thread. |
Hi guys, Any update on this one ? Thanks ! |
@NicoNes Would you be interested in creating a PR targeted to the |
@spericas Sure, I'll do it. |
This PR is my proposal to fix issue 736.
It was about:
Response.readEntity(...)
andResponse.getEntity()
methods.As spotted by @ronsigal , that cache concept appears to be inconsistent with a TCK test from "com.sun.ts.tests.jaxrs.ee.rs.core.response.JAXRSClient" called "getEntityThrowsIllegalStateExceptionWhenConsumedTest" . Actually according to this TCK test, if
readEntity(...)
was previously invoked then the next invocation ofgetEntity()
must throw anIllegalStateException
.Let me know what you think.
Thanks