Skip to content

Commit

Permalink
fix(build): Fix spring warnings about validated classes (spinnaker#273)
Browse files Browse the repository at this point in the history
As of Spring Boot 1.5, @ConfigurationProperties classes that use
constraint annotations should also be annotated with @validated; this is
currently throwing warnings but may actually break in the future.
  • Loading branch information
ezimanyi authored Jun 11, 2018
1 parent b5e2a2a commit 90f3469
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import org.springframework.validation.annotation.Validated;

@Data
@ConfigurationProperties(prefix = "pubsub.google")
@Validated
public class GooglePubsubProperties {

@Valid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import groovy.transform.CompileStatic
import org.hibernate.validator.constraints.NotEmpty
import org.springframework.boot.context.properties.ConfigurationProperties
import org.springframework.context.annotation.Configuration
import org.springframework.validation.annotation.Validated

import javax.validation.Valid

Expand All @@ -29,6 +30,7 @@ import javax.validation.Valid
@Configuration
@CompileStatic
@ConfigurationProperties(prefix = 'rest')
@Validated
class RestProperties {
@Valid
List<RestEndpointConfiguration> endpoints
Expand Down

0 comments on commit 90f3469

Please sign in to comment.