-
-
Save behrangsa/61f60b0e70c6d3e2fec3f2cd432df517 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.more") | |
@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