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 Jackson ConstructorDetector properties support #27178

Closed
philwebb opened this issue Jul 7, 2021 · 4 comments
Closed

Add Jackson ConstructorDetector properties support #27178

philwebb opened this issue Jul 7, 2021 · 4 comments
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@philwebb
Copy link
Member

philwebb commented Jul 7, 2021

Jakson added ConstructorDetector support in FasterXML/jackson-databind#1498. It would be nice if this could be configured in application.properties in a similar way to other Jackson features.

@snicoll
Copy link
Member

snicoll commented Aug 16, 2021

Just a note that ConstructorDetector isn't an enum as I thought it would be. It's actually a POJO with three attributes: a mode (enum) for single arg constructor, whether a @JsonCreator is required, and whether constructors for JDK types can be considered. It looks like the latter is fairly advanced so I am wondering if we should rather expose the enum only and let more advanced use case to be configured via a customizer.

@snicoll snicoll added the for: team-attention An issue we'd like other members of the team to review label Aug 16, 2021
@philwebb
Copy link
Member Author

I'm not really sure if we should use the SingleArgConstructor enum, or declare a new one that mirrors the statics in ConstructorDetector. I do think we shouldn't try to cover all the with... methods in properties.

@philwebb
Copy link
Member Author

I'm kind of leaning towards a spring.jackson.constructor-detector property with default, use-property-based, use-delegating and explicit-only as values.

@snicoll snicoll self-assigned this Aug 17, 2021
@snicoll snicoll removed the for: team-attention An issue we'd like other members of the team to review label Aug 17, 2021
@snicoll snicoll modified the milestones: 2.6.x, 2.6.0-M2 Aug 17, 2021
@snicoll
Copy link
Member

snicoll commented Aug 17, 2021

We need a new enum anyway as this feature has been introduced in Jackson 2.12 and we still have support for 2.11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants