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

Add includeNoArgsConstructor option #1622

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lengors
Copy link

@lengors lengors commented Jul 10, 2024

Motivation

The no-args constructor is not necessary for all serializarers and deserializers. For example. when using Micronaut with serde, it's perfectibily acceptable to not have the no-args constructor for serialization and deserialization to be successful. Not only that, but it actually interferes with the deserialization process when the includeSetters option is set to false (all properties constructor would require being annotated with @JsonCreator for all properties to be set accordingly).

Example showcasing motivation: micronaut-serde-examples.

Purposal

As such, I'm creating this PR which implements the includeNoArgsConstructor option, set to true by default for backwards compatibility reasons and allows the user to disable the generation of the no-args constructor.

Edit: second commit reverts default compiler version for integration-tests to 1.6 because I had change it to 1.8 to run the tests locally and accidentally committed it

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.

1 participant