Skip to content

Add includeNoArgsConstructor option#1622

Open
lengors wants to merge 2 commits intojoelittlejohn:masterfrom
lengors:feature/add-include-no-args-constructor-option
Open

Add includeNoArgsConstructor option#1622
lengors wants to merge 2 commits intojoelittlejohn:masterfrom
lengors:feature/add-include-no-args-constructor-option

Conversation

@lengors
Copy link
Copy Markdown

@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

@ctrimble ctrimble added this to the 1.3.0 milestone Sep 3, 2025
@joelittlejohn joelittlejohn removed this from the 1.3.0 milestone Jan 31, 2026
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.

3 participants