Created
January 8, 2018 11:19
-
-
Save anonymous/abf07b149497f0ff97437ea9627003a1 to your computer and use it in GitHub Desktop.
StackOverflow - https://stackoverflow.com/questions/48143831/how-to-validate-configuration-property-only-if-a-certain-profile-is-active
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Data | |
@Component | |
@ConfigurationProperties(prefix = "sample") | |
@Validated | |
public class SampleProperties { | |
@NotNull | |
private String sample1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Data | |
@Component | |
@ConfigurationProperties(prefix = "sample") | |
@Validated | |
@Profile("more") | |
public class MoreProperties { | |
@NotNull | |
private String sample2; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment