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
Support @JsonTypeInfo(visible=true)
#638
Conversation
dstepanov
commented
Nov 2, 2023
•
edited
edited
- which allows for the deserializer to set the type discriminator as an ordinary property
@@ -212,6 +220,15 @@ Decoder consume() { | |||
} | |||
} | |||
|
|||
Decoder buffer() throws IOException { |
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.
how can this work, you cant use the Decoder returned by decodeBuffer multiple times
throw new IllegalStateException("Already drained"); | ||
} | ||
complete = true; | ||
// No-op: Allow to read multiple times |
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.
ohhhhhh. no we should definitely not allow this. it will break with more efficient implementations.
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 will try a different solution
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.
Yeah, maybe we can allow to clone the buffer
ive modified it slightly, internally it's very similar (still JsonNode) but i've moved the "duplication logic" to the demuxing decoder and only apply it to the property where it's necessary. In other cases I still use normal decodeBuffer. The reason for this change is that I want to avoid expanding the contract for decodeBuffer. Right now, decodeBuffer does not permit "aliasing": It does not allow two decodeXYZ calls to the same value, even if it's been buffered at some point. This guarantee may be helpful in the future for efficiency improvements such as lazy decoding, jackson TokenBuffer etc. |
serde-api/src/main/java/io/micronaut/serde/config/annotation/SerdeConfig.java
Outdated
Show resolved
Hide resolved
…erdeConfig.java Co-authored-by: Jonas Konrad <jonas.konrad@oracle.com>
SonarCloud Quality Gate failed. 0 Bugs 88.3% Coverage Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
@dstepanov when you planned release these changes? Want also add fix in micronaut-openapi for version 5.2.0 |
Probably with 4.2 platform release next week |