Skip to content
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

Merged
merged 3 commits into from Nov 3, 2023
Merged

Support @JsonTypeInfo(visible=true) #638

merged 3 commits into from Nov 3, 2023

Conversation

dstepanov
Copy link
Contributor

@dstepanov dstepanov commented Nov 2, 2023

  • which allows for the deserializer to set the type discriminator as an ordinary property

@@ -212,6 +220,15 @@ Decoder consume() {
}
}

Decoder buffer() throws IOException {
Copy link
Member

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
Copy link
Member

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.

Copy link
Member

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

Copy link
Contributor Author

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

@yawkat
Copy link
Member

yawkat commented Nov 3, 2023

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.

…erdeConfig.java

Co-authored-by: Jonas Konrad <jonas.konrad@oracle.com>
Copy link

sonarcloud bot commented Nov 3, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

88.3% 88.3% Coverage
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@altro3
Copy link
Contributor

altro3 commented Nov 3, 2023

@dstepanov when you planned release these changes? Want also add fix in micronaut-openapi for version 5.2.0

@dstepanov
Copy link
Contributor Author

Probably with 4.2 platform release next week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants