snowdrop-zen / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
1 stars 0 forks source link

Add `fail on empty beans` jackson mapper property to application properties #385

Closed snowdrop-bot closed 3 years ago

snowdrop-bot commented 3 years ago

Description

By default Jackson mapper FAIL_ON_EMPTY_BEANS is set to true. Would be great to be able to set this property to false through an application property as we do with other Jackson mapper properties:

quarkus.jackson.fail-on-unknown-properties quarkus.jackson.write-dates-as-timestamps quarkus.jackson.accept-case-insensitive-enums quarkus.jackson.timezone

In this way, we could avoid other verbose solutions as extends ObjectMapperCustomizer Example:


@Singleton
public class VertxAuthObjectMapperCustomizer implements ObjectMapperCustomizer {

    @Override
    public void customize(ObjectMapper objectMapper) {
        objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
    }
}

Implementation ideas

Support the following property:

quarkus.jackson.fail-on-empty-beans=false


https://github.com/quarkusio/quarkus/issues/18927


$upstream:18927$