-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Reflection-free Serialization issue when first accessed vs. second access or if multiple methods #46156
Comments
@mariofusco looks like a good puzzle for you :) |
I wanted to double-check my work so you didn't think I was a fool with this issue (and to make sure I was not losing my mind). Originally, for the life of me I could not replicate this and I literally copied almost the exact code over. It wasn't until I generated the decompiled output and compared those and saw the only difference was the list endpoint was missing (not that this is the root cause of the issue just the only thing different). Once I added that I get the same results. In all cases, up to the point it is returned in the response, the "model" has the correct values and if i set So, the issues I have are:
Scenario 1:
Once it shows up in the response (after step# 5) it always does. Note, here it seems to also ignore the Scenario 2:
This is the same as scenario1 except rather than "extending" the base I have the all fields inside the model. Note, here it respects the Scenario 3:
Other things I tried but had no effect:
When running under Now, here is where it gets more interesting. I have other services with the exact same pattern just different models. Those work (tests verify these and I performed the same steps above in dev and staging environments). I beefed up my reproducer and cleaned it up to remove what was not needed: |
It has nothing to do with the |
I deleted my code-with-quarkus2.zip because I thought that was irrelavant but it still holds true - if you replace |
I will check this asap, but this week I'm traveling so it won't be immediate. |
I have an isolated reproducer and know why this is happening. I need a bit of time to implement a solution, something related to what I discussed here FasterXML/jackson-databind#1784 |
No worries on our end, we have two acceptable solutions that work (unless you think otherwise). Thank you for looking into this. I wish I could of been more help but now I am more interested in the why (which I sort of followed from that thread). |
Fixed by #46211 |
Describe the bug
The weirdest issue and I do not understand why.
When reflection-free serialization is on I have a case where the object is not properly serialized the first time but if I reload the dev server it works the second time. In production it just did not work.
In our real code we can verify these issues:
@JsonIgnore
and make them all@JsonProperty
it seems to work fine.I was finally able to replicated it after I compared the bytecode and then added the "list" endpoint so that it matched our scenario.
Expected behavior
Serialization works the same when reflection-free is enabled for simple POJOs
Actual behavior
Various issues but the children object happens to be missing in this case.
Reloading quarkus:dev and hitting the same URL works the 2nd time.
How to Reproduce?
Scenario 1:
mvn quarkus:dev
Scenario 2:
mvn quarkus:dev
code-with-quarkus.zip
Output of
uname -a
orver
No response
Output of
java -version
No response
Quarkus version or git rev
3.18.2
Build tool (ie. output of
mvnw --version
orgradlew --version
)Maven
Additional information
No response
The text was updated successfully, but these errors were encountered: