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

Validation on nested configuration not working #266

Closed
snowdrop-bot opened this issue Feb 15, 2021 · 0 comments
Closed

Validation on nested configuration not working #266

snowdrop-bot opened this issue Feb 15, 2021 · 0 comments

Comments

@snowdrop-bot
Copy link
Collaborator

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


quarkusio#15081


$upstream:15081$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants