We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
See https://fasterxml.github.io/jackson-annotations/javadoc/2.8/com/fasterxml/jackson/annotation/JsonUnwrapped.html
The text was updated successfully, but these errors were encountered:
I mean I don't mind adding it, but like why would someone want to do this?
Sorry, something went wrong.
There's a lot of potential use cases. For instance, I have a lot of typed IDs in my project, e.g.:
record UserId ( UUID id ) {}
If I have a User record such as:
User
record User ( UserId id, String email, String name, ... ) {}
I don't want my serialized User to be:
{ "id": { "id": "some uuid" }, "email": "[email protected]", "name": "Some Name", ... }
So it's helpful to be able to easily "flatten" certain objects.
Of course I could also provide a custom serializer, or even create an extra record for the API layer alone, but that adds a lot of boilerplate code.
There's a lot of potential use cases. For instance, I have a lot of typed IDs in my project, e.g.: record UserId ( UUID id ) {}
You can actually make this work now with @Value
@Value
record UserId ( @Json.Value UUID id ) {}
No branches or pull requests
See https://fasterxml.github.io/jackson-annotations/javadoc/2.8/com/fasterxml/jackson/annotation/JsonUnwrapped.html
The text was updated successfully, but these errors were encountered: