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 unwrapped subtype beans #624

Merged
merged 1 commit into from Oct 30, 2023
Merged

Support unwrapped subtype beans #624

merged 1 commit into from Oct 30, 2023

Conversation

dstepanov
Copy link
Contributor

Fixes #263

@sonarcloud
Copy link

sonarcloud bot commented Oct 30, 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 8 Code Smells

78.3% 78.3% Coverage
0.4% 0.4% Duplication

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

* @since 2.3
*/
@Indexed(ObjectSerializer.class)
public interface ObjectSerializer<T> extends Serializer<T> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this is a confusing name?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would you suggest? Before I had SerializerInto but I think it makes more sense to call it ObjectSerializer because serializeInto can only be used with a serializer representing JSON objects {...}.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UnwrappedObjectSerializer maybe

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is that an object serializer is any serializer representing an object, and if you put the unwrapped annotation, it will use serializeInto method to avoid creating an outer object.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Going to merge it, and rename it later if you have a better suggestion

@dstepanov dstepanov merged commit d952f97 into master Oct 30, 2023
11 of 12 checks passed
@dstepanov dstepanov deleted the wrapsubtype branch October 30, 2023 15:08
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.

@JsonUnwrapped cannot serialize subtypes
3 participants