Skip to content

[REQ] [SPRING] Improve constructor generations #22843

@jpfinne

Description

@jpfinne

Is your feature request related to a problem? Please describe.

Spring constructor can be improved with better support for Jackson and for JSpecify.

Describe the solution you'd like

The Spring generator can generate 3 types of constructors:

  • default empty constructor
  • constructor for required fields
  • constructor for all arguments

We can improve them by adding the @JsonProperty on the fields of the constructors. It is already done in the RestClient.
Adding the @JsonCreator on the all argument constructor to help jackson.
Fix #22757 when using all argument constructors.
Use JSpecify @NullUnmarked on the default constructor to avoid false alarms from code analysis.

Describe alternatives you've considered

custom templates.
Add full support for JSpecify

Additional context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions