You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add Jakarta Bean Validation annotations to the CleanupConfig class to permit validation, for example if an application uses external configuration to specify the configuration to use when cleaning up application errors.
This does not require adding a new dependency, since this library already depends (transitively) on jakarta.validation:jakarta.validation-api. However, it does now make it an explicit dependency, so we should probably make it explicit in the POM.
The text was updated successfully, but these errors were encountered:
Since we're using Dropwizard's Duration class (io.dropwizard.util.Duration) in this configuration class, it makes sense to not only use standard validation Jakarta Bean Validation annotations like @NotNull but also to use Dropwizard's own custom validation annotations, in this case to use @MinDuration on the Duration fields. Since we mainly want to ensure that the duration isn't zero (or even negative), we can make the minimum as 1 minute for the fields. That probably isn't very useful in real life for most applications, but it ensures there is at least a valid minimum. I don't think we should set any maximum durations, since maybe someone wants to save them for 1 year, 2 years, etc. or even effectively forever by using a very large number of days.
So, we'll also want to add dropwizard-validation as an explicit dependency. Currently it is a transitive dependency via dropwizard-core.
* Update the version in the POM to 2.1.0-SNAPSHOT
* Add dropwizard-validation and jakarta.validation-api as explicit
dependencies, since we're using both standard Jakarta annotations
and a Dropwizard one
* Make all references types @NotNull in CleanupConfig
* Make all Duration types @MinDuration of 1 minute
* Add a bunch of tests, and enhance the existing test of default values
Closes#302
* Update the version in the POM to 2.1.0-SNAPSHOT
* Add dropwizard-validation and jakarta.validation-api as explicit
dependencies, since we're using both standard Jakarta annotations
and a Dropwizard one
* Make all references types @NotNull in CleanupConfig
* Make all Duration types @MinDuration of 1 minute
* Add a bunch of tests, and enhance the existing test of default values
Closes#302
Add Jakarta Bean Validation annotations to the
CleanupConfig
class to permit validation, for example if an application uses external configuration to specify the configuration to use when cleaning up application errors.This does not require adding a new dependency, since this library already depends (transitively) on
jakarta.validation:jakarta.validation-api
. However, it does now make it an explicit dependency, so we should probably make it explicit in the POM.The text was updated successfully, but these errors were encountered: