spring-boot icon indicating copy to clipboard operation
spring-boot copied to clipboard

Auto-configure Hibernate with a JsonFormatMapper

Open nosan opened this issue 1 year ago • 6 comments

#33870

nosan avatar Oct 14 '24 18:10 nosan

Thanks, @nosan.

Before merging this, we should consider if we want a way to disable it (an application property?) as it has the potential to be a breaking change.

wilkinsona avatar Oct 15 '24 08:10 wilkinsona

Thanks, @wilkinsona I was also thinking about this but I have not found a good name for it. Maybe spring.jpa.hibernate.auto-configure.json-format-mapper ?

nosan avatar Oct 15 '24 08:10 nosan

I also used properties.putIfAbsent in case someone already has registered they own JsonFormatMapper

nosan avatar Oct 15 '24 08:10 nosan

Thanks, @nosan. While looking for some inspiration for a property name, a couple of other things came to mind. I've noted them in a comment on 33870. I'll put this on hold for now until we've had a chance to figure those out.

wilkinsona avatar Oct 18 '24 15:10 wilkinsona

Thanks, @wilkinsona. That makes sense.

What do you think about the following property format?

spring.jpa.hibernate.auto-configure.json-format-mapper=none
spring.jpa.hibernate.auto-configure.json-format-mapper=jackson
spring.jpa.hibernate.auto-configure.json-format-mapper=jsonb

By default, for example, jackson, as it is more popular.

nosan avatar Oct 18 '24 15:10 nosan

I'm not sure, unfortunately. I'm wondering if we need to widen the scope of the existing MVC-specific property and rename it to be more generally applicable. Let's keep that discussion to #33870 and then come back here once we're ready to update the proposal.

wilkinsona avatar Oct 18 '24 16:10 wilkinsona

I'm going to close this one, for now at least, as the underlying issue is blocked indefinitely while the Hibernate feature is incubating. Thanks anyway, @nosan.

wilkinsona avatar Feb 18 '25 12:02 wilkinsona