Last active
January 3, 2019 13:02
-
-
Save rbaul/e99c8eaebd44fba0abc8a13c761e27ec to your computer and use it in GitHub Desktop.
Custom Configuration Properties
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
documentation: | |
baseurl: newlocalhost | |
swagger: | |
services: | |
- | |
name: My Service | |
url: ${documentation.baseurl}/.... | |
version: 2.0 | |
- | |
name: My Service | |
url: ${documentation.baseurl}/.... | |
version: 2.0 |
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
import lombok.Getter; | |
import lombok.Setter; | |
import lombok.ToString; | |
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; | |
import org.springframework.boot.context.properties.ConfigurationProperties; | |
import org.springframework.boot.context.properties.EnableConfigurationProperties; | |
import java.util.List; | |
@Getter | |
@Setter | |
@EnableConfigurationProperties | |
@ConfigurationProperties(prefix = "documentation.swagger") | |
public class SwaggerServicesConfig { | |
private String baseurl = "localhost"; | |
private List<SwaggerServices> services; | |
@Getter | |
@Setter | |
@ToString | |
@EnableConfigurationProperties | |
public static class SwaggerServices { | |
private String name; | |
private String url; | |
private String version; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment