snowdrop-zen / quarkus

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

Validation on nested configuration not working #266

Closed snowdrop-bot closed 3 years ago

snowdrop-bot commented 3 years ago

From https://quarkusio.zulipchat.com/#narrow/stream/187030-users/topic/Using.20.40ConfigProperties.20with.20validation/near/226199040

quarkus-config-sample.zip

Describe the bug According to https://quarkus.io/guides/config-reference#additional-notes-on-configproperties I should be able to validate nested configuration but it doesn't seem to work, regardless if I use private members with getters/setters, public fields, or interfaces.

Expected behavior I would expect the application to fail when starting up and saying

ERROR [io.qua.run.Application] (Quarkus Main Thread) Failed to start application (with profile dev): javax.validation.ConstraintViolationException: prizeAmount: must be greater than 0
    at io.quarkus.arc.runtime.config.ConfigPropertiesProducer.produceGreetingConfiguration(ConfigPropertiesProducer.zig:198)

Actual behavior The application starts up without error

To Reproduce Reproducer application attached.

Configuration

greeting.message=hello
greeting.name=quarkus
greeting.content.prize-amount=0
greeting.content.recipients=Jane,John

quarkus-config-sample.zip


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


$upstream:15081$