{"id":51010,"date":"2016-01-14T13:00:29","date_gmt":"2016-01-14T11:00:29","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=51010"},"modified":"2016-01-14T12:23:29","modified_gmt":"2016-01-14T10:23:29","slug":"pimp-config-configuration-meta-data-spring-boot","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2016\/01\/pimp-config-configuration-meta-data-spring-boot.html","title":{"rendered":"Pimp your config with configuration meta-data in Spring Boot"},"content":{"rendered":"<p>There were many updates released in the Spring Boot 1.3.0 but one of them stood out to me because I was not aware of this before and the state it got to makes it one really useful feature (unfortunately available only in Spring Boot as of writing this). I am talking about configuration meta-data and the processing related to this area of framework \/ application. As I will demonstrate further, there are several ways you can make use of it and the framework also allows you to leverage the benefits of automated processing. If you feel the need to take the matters into your own hands don\u2019t worry \u2013 there is a way of manual entry as well if you want to use some of the features allowing you to precisely tailor your setup. Let\u2019s talk configuration.<\/p>\n<h2>Configuration meta-data in Spring Boot<\/h2>\n<p>Let\u2019s face it \u2013 we have all been there. The application you are working on must be configurable however when it comes to actual documentation things get bit weird. There are usually several ways the team handles this nifty task. Whether it is described and managed in a project wiki, part of the comments in the property files, written down in Javadoc comments or it does not exists at all, we can all agree that this is far from the desired state of the affairs. There are several challenges involved in this like making the documentation available to all the stakeholders (like devops team), versioning and keeping it up to date (especially updates that are not backwards compatible) or simply making it clear what options are available or deprecated and what do they mean to the application.<\/p>\n<h2>Project setup<\/h2>\n<p>First step is to set everything up. As mentioned earlier, you will need to use Spring Boot 1.3.0 or newer together with special dependency ensuring recompilation of the file containing metadata that are processed by other tools like IDEs later on. The artifact is called <code>spring-boot-configruation-processor<\/code> and it should be marked as <code>optional<\/code>.<\/p>\n<p><em><strong>Spring boot dependency in pom.xml<\/strong><\/em><\/p>\n<pre class=\"brush:xml\">&lt;parent&gt;\r\n    &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\r\n    &lt;artifactId&gt;spring-boot-starter-parent&lt;\/artifactId&gt;\r\n    &lt;version&gt;1.3.1.RELEASE&lt;\/version&gt;\r\n    &lt;relativePath\/&gt;\r\n&lt;\/parent&gt;\r\n \r\n&lt;dependencies&gt;\r\n    ...\r\n \r\n    &lt;dependency&gt;\r\n        &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\r\n        &lt;artifactId&gt;spring-boot-configuration-processor&lt;\/artifactId&gt;\r\n        &lt;optional&gt;true&lt;\/optional&gt;\r\n    &lt;\/dependency&gt;\r\n \r\n    ...\r\n&lt;\/dependencies&gt;<\/pre>\n<p>The second step of this setup is to enable configuration properties and actually create a class that contains them. This is a fairly simple task (especially if you have prior experience with Spring Boot). Let\u2019s call this class <code>MyProperties<\/code>.<\/p>\n<p><em><strong>Configuration class enabling configuration properties<\/strong><\/em><\/p>\n<pre class=\"brush:java\">@Configuration\r\n@EnableConfigurationProperties({MyProperties.class})\r\npublic class ApplicationConfiguration {\r\n \r\n    @Autowired\r\n    private MyProperties myProperties;\r\n \r\n    public MyProperties getMyProperties() {\r\n        return myProperties;\r\n    }\r\n \r\n    public void setMyProperties(MyProperties myProperties) {\r\n        this.myProperties = myProperties;\r\n    }\r\n}<\/pre>\n<h2>Configuration metadata out-of-the-box<\/h2>\n<p><code>MyProperties<\/code> class reflects properties prefixed with the word <code>my<\/code>. Now that we have everything setup and ready to go, let\u2019s take a look at how this mechanism works for two most basic cases. Consider these two configuration properties \u2013 a single <code>String<\/code> property (<code>property<\/code>) and a property using an <code>enum<\/code> value (<code>copyOption<\/code>). Both of these properties are described using standard Javadoc, plus in case of <code>StandardCopyOption<\/code>, each <code>enum<\/code> value has its own Javadoc comment. Spring Boots support for configuration metadata tries to leverage the maximum from the code since it is expected from developer to comment their configuration properties properly (really useful and handy in case of <code>enum<\/code>s).<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p><em><strong>Sample configuration properties class<\/strong><\/em><\/p>\n<pre class=\"brush:java\">@ConfigurationProperties(prefix = \"my\")\r\npublic class MyProperties {\r\n \r\n    \/**\r\n     * String property used to configure my app.\r\n     *\/\r\n    private String property;\r\n \r\n    \/**\r\n     * Configuration for file operations.\r\n     *\/\r\n    private StandardCopyOption copyOption;\r\n \r\n    public String getProperty() {\r\n        return property;\r\n    }\r\n \r\n    public void setProperty(String property) {\r\n        this.property = property;\r\n    }\r\n \r\n    public StandardCopyOption getCopyOption() {\r\n        return copyOption;\r\n    }\r\n \r\n    public void setCopyOption(StandardCopyOption copyOption) {\r\n        this.copyOption = copyOption;\r\n    }\r\n    \r\n}<\/pre>\n<p>Now it is time to see the magic happen. The Spring dependency mentioned earlier ensures that the metadata is generated during the build of your project. In order to get something out of this whole setup, you need to know how does your IDE support this Spring Boot feature. For example, as far as I know, Eclipse IDEs on save action\/event triggers a build which takes care of keeping the metadata up-to-date. When it comes to IntelliJ IDEA, you need to trigger the build manually since there is no saving \/ on save event. Once the build is over, you can explore the <code>target<\/code> folder (in case of using maven) and look for newly added file\u00a0<code>target\\classes\\META-INF\\spring-configuration-metadata.json<\/code>. Given the code above, you should see something similar to this:<\/p>\n<p><em><strong>Contents of target\\classes\\META-INF\\spring-configuration-metadata.json<\/strong><\/em><\/p>\n<pre class=\"brush:js\">{\r\n  \"groups\": [{\r\n    \"name\": \"my\",\r\n    \"type\": \"com.jakubstas.s3downloader.MyProperties\",\r\n    \"sourceType\": \"com.jakubstas.s3downloader.MyProperties\"\r\n  }],\r\n  \"properties\": [\r\n    {\r\n      \"name\": \"my.copy-option\",\r\n      \"type\": \"java.nio.file.StandardCopyOption\",\r\n      \"description\": \"Configuration for file operations.\",\r\n      \"sourceType\": \"com.jakubstas.s3downloader.MyProperties\"\r\n    },\r\n    {\r\n      \"name\": \"my.property\",\r\n      \"type\": \"java.lang.String\",\r\n      \"description\": \"String property used to configure my app.\",\r\n      \"sourceType\": \"com.jakubstas.s3downloader.MyProperties\"\r\n    }\r\n  ],\r\n  \"hints\": []\r\n}<\/pre>\n<p>This file is now available to either a tool to be read and processed, or to a team member to examine to see how to configure the application. That being said, once I open <code>application.properties<\/code> in IntelliJ IDEAs editor and start typing the prefix for each of my properties, I am greeted by a familiar automatic code completion window that has the notion of what each of\u00a0my properties is used for\u00a0(based on the Javadoc comment):<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2016\/01\/simple-properties.png\" rel=\"attachment wp-att-51034\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-51034\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2016\/01\/simple-properties.png\" alt=\"simple-properties\" width=\"687\" height=\"85\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2016\/01\/simple-properties.png 687w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2016\/01\/simple-properties-300x37.png 300w\" sizes=\"(max-width: 687px) 100vw, 687px\" \/><\/a><\/p>\n<p>In case of the <code>enum<\/code> property, I am also able to see each of the <code>enum<\/code>s values with their respective Javadoc comment:<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2016\/01\/simple-enum-property.png\" rel=\"attachment wp-att-51035\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-51035\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2016\/01\/simple-enum-property.png\" alt=\"simple-enum-property\" width=\"749\" height=\"117\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2016\/01\/simple-enum-property.png 749w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2016\/01\/simple-enum-property-300x47.png 300w\" sizes=\"(max-width: 749px) 100vw, 749px\" \/><\/a><\/p>\n<h2>Default value selection<\/h2>\n<p>One of the most basic use cases for configuration documentation is selecting a sensible default value for your configuration properties so that it is as easy as possible to configure your application. Let\u2019s take a look at how to achieve this in this setup. In order to allow any manual entry into the <code>spring-configuration-metadata.json\u00a0file<\/code>, developer must first create a new separate file that is later picked up by the build process. It is another json file called <code>additional-spring-configuration-metadata.json<\/code>\u00a0that is supposed to be created in <code>META-INF<\/code> folder and must follow syntax described in <a href=\"http:\/\/docs.spring.io\/spring-boot\/docs\/1.3.1.RELEASE\/reference\/html\/configuration-metadata.html\" target=\"_blank\">Appendix B. Configuration meta-data<\/a>.<\/p>\n<p>That way, once I decide on my defaults and available options (I want to present two predefined options yet still allow for any other <code>String<\/code> values to be used in my <code>String<\/code> property), I can create that file with following content:<\/p>\n<p><em><strong>Contents of additional-spring-configuration-metadata.json<\/strong><\/em><\/p>\n<pre class=\"brush:js\">{\r\n  \"properties\": [\r\n    {\r\n      \"name\": \"my.copy-option\",\r\n      \"type\": \"java.lang.String\",\r\n      \"sourceType\": \"java.nio.file.StandardCopyOption\",\r\n      \"defaultValue\": \"replace_existing\"\r\n    },\r\n    {\r\n      \"name\": \"my.property\",\r\n      \"defaultValue\": \"something\"\r\n    }\r\n  ],\r\n  \"hints\": [\r\n    {\r\n      \"name\": \"my.property\",\r\n      \"values\": [\r\n        {\r\n          \"value\": \"nothing\",\r\n          \"description\": \"Does nothing.\"\r\n        },\r\n        {\r\n          \"value\": \"something\",\r\n          \"description\": \"Does something.\"\r\n        }\r\n      ]\r\n    }\r\n  ]\r\n}<\/pre>\n<p>This results in pretty much what one would expect and can already see in some of the Spring Boot dependencies. In case of the <code>String<\/code> property, both of the options are presented with their respective descriptions. The default option has been bolted.<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2016\/01\/default-string-property.png\" rel=\"attachment wp-att-51036\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-51036\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2016\/01\/default-string-property.png\" alt=\"default-string-property\" width=\"393\" height=\"71\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2016\/01\/default-string-property.png 393w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2016\/01\/default-string-property-300x54.png 300w\" sizes=\"(max-width: 393px) 100vw, 393px\" \/><\/a><\/p>\n<p>The behavior of <code>enum<\/code> property is slightly different since the IDE doesn\u2019t bolt the option, but places it at the top of the list.<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2016\/01\/default-enum-property.png\" rel=\"attachment wp-att-51037\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-51037\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2016\/01\/default-enum-property.png\" alt=\"default-enum-property\" width=\"747\" height=\"117\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2016\/01\/default-enum-property.png 747w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2016\/01\/default-enum-property-300x47.png 300w\" sizes=\"(max-width: 747px) 100vw, 747px\" \/><\/a><\/p>\n<p>And finally, let\u2019s take a look at what you get when you haven\u2019t selected any particular property yet. In this case, both properties show their descriptions\u00a0from Javadoc and their default values.<\/p>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2016\/01\/default-properties.png\" rel=\"attachment wp-att-51038\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-51038\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2016\/01\/default-properties.png\" alt=\"default-properties\" width=\"841\" height=\"85\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2016\/01\/default-properties.png 841w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2016\/01\/default-properties-300x30.png 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2016\/01\/default-properties-768x78.png 768w\" sizes=\"(max-width: 841px) 100vw, 841px\" \/><\/a><\/p>\n<h2>Conclusion<\/h2>\n<p>This was a short introduction into the way how you can make your configuration shine. This post only scrapped the surface\u00a0of what is possible to achieve and it still managed to show a great potential of this feature. I encourage you to give this feature a try and see for yourself if the setup like this works for you and your team. I will go into more detail and advanced features of this configuration support in the next post. Stay tuned!<\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td><span class=\"reference\">Reference: <\/span><\/td>\n<td><a href=\"http:\/\/jakubstas.com\/configuration-meta-data-in-spring-boot\/\">Pimp your config with configuration meta-data in Spring Boot<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/join-us\/jcg\/\">JCG partner<\/a> Jakub Stas at the <a href=\"http:\/\/jakubstas.com\/\">Jakub Stas<\/a> blog.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>There were many updates released in the Spring Boot 1.3.0 but one of them stood out to me because I was not aware of this before and the state it got to makes it one really useful feature (unfortunately available only in Spring Boot as of writing this). I am talking about configuration meta-data and &hellip;<\/p>\n","protected":false},"author":569,"featured_media":240,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[30,854],"class_list":["post-51010","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-spring","tag-spring-boot"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Pimp your config with configuration meta-data in Spring Boot - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"There were many updates released in the Spring Boot 1.3.0 but one of them stood out to me because I was not aware of this before and the state it got to\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2016\/01\/pimp-config-configuration-meta-data-spring-boot.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Pimp your config with configuration meta-data in Spring Boot - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"There were many updates released in the Spring Boot 1.3.0 but one of them stood out to me because I was not aware of this before and the state it got to\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2016\/01\/pimp-config-configuration-meta-data-spring-boot.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2016-01-14T11:00:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Jakub Stas\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@jakub_stas\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jakub Stas\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/01\\\/pimp-config-configuration-meta-data-spring-boot.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/01\\\/pimp-config-configuration-meta-data-spring-boot.html\"},\"author\":{\"name\":\"Jakub Stas\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/2927b40b7959304127862052f0a267ab\"},\"headline\":\"Pimp your config with configuration meta-data in Spring Boot\",\"datePublished\":\"2016-01-14T11:00:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/01\\\/pimp-config-configuration-meta-data-spring-boot.html\"},\"wordCount\":1070,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/01\\\/pimp-config-configuration-meta-data-spring-boot.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"keywords\":[\"Spring\",\"Spring Boot\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/01\\\/pimp-config-configuration-meta-data-spring-boot.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/01\\\/pimp-config-configuration-meta-data-spring-boot.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/01\\\/pimp-config-configuration-meta-data-spring-boot.html\",\"name\":\"Pimp your config with configuration meta-data in Spring Boot - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/01\\\/pimp-config-configuration-meta-data-spring-boot.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/01\\\/pimp-config-configuration-meta-data-spring-boot.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"datePublished\":\"2016-01-14T11:00:29+00:00\",\"description\":\"There were many updates released in the Spring Boot 1.3.0 but one of them stood out to me because I was not aware of this before and the state it got to\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/01\\\/pimp-config-configuration-meta-data-spring-boot.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/01\\\/pimp-config-configuration-meta-data-spring-boot.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/01\\\/pimp-config-configuration-meta-data-spring-boot.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"width\":150,\"height\":150,\"caption\":\"spring-interview-questions-answers\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2016\\\/01\\\/pimp-config-configuration-meta-data-spring-boot.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Pimp your config with configuration meta-data in Spring Boot\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/2927b40b7959304127862052f0a267ab\",\"name\":\"Jakub Stas\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0702ca1cf6a3bcd1926cba7c5b1d9a17b016a8cff098389e8f5f1cd22837a1c6?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0702ca1cf6a3bcd1926cba7c5b1d9a17b016a8cff098389e8f5f1cd22837a1c6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0702ca1cf6a3bcd1926cba7c5b1d9a17b016a8cff098389e8f5f1cd22837a1c6?s=96&d=mm&r=g\",\"caption\":\"Jakub Stas\"},\"sameAs\":[\"http:\\\/\\\/jakubstas.com\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/jakubstas\",\"https:\\\/\\\/x.com\\\/jakub_stas\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/jakub-stas\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Pimp your config with configuration meta-data in Spring Boot - Java Code Geeks","description":"There were many updates released in the Spring Boot 1.3.0 but one of them stood out to me because I was not aware of this before and the state it got to","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2016\/01\/pimp-config-configuration-meta-data-spring-boot.html","og_locale":"en_US","og_type":"article","og_title":"Pimp your config with configuration meta-data in Spring Boot - Java Code Geeks","og_description":"There were many updates released in the Spring Boot 1.3.0 but one of them stood out to me because I was not aware of this before and the state it got to","og_url":"https:\/\/www.javacodegeeks.com\/2016\/01\/pimp-config-configuration-meta-data-spring-boot.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2016-01-14T11:00:29+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","type":"image\/jpeg"}],"author":"Jakub Stas","twitter_card":"summary_large_image","twitter_creator":"@jakub_stas","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Jakub Stas","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2016\/01\/pimp-config-configuration-meta-data-spring-boot.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/01\/pimp-config-configuration-meta-data-spring-boot.html"},"author":{"name":"Jakub Stas","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/2927b40b7959304127862052f0a267ab"},"headline":"Pimp your config with configuration meta-data in Spring Boot","datePublished":"2016-01-14T11:00:29+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/01\/pimp-config-configuration-meta-data-spring-boot.html"},"wordCount":1070,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/01\/pimp-config-configuration-meta-data-spring-boot.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","keywords":["Spring","Spring Boot"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2016\/01\/pimp-config-configuration-meta-data-spring-boot.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2016\/01\/pimp-config-configuration-meta-data-spring-boot.html","url":"https:\/\/www.javacodegeeks.com\/2016\/01\/pimp-config-configuration-meta-data-spring-boot.html","name":"Pimp your config with configuration meta-data in Spring Boot - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/01\/pimp-config-configuration-meta-data-spring-boot.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/01\/pimp-config-configuration-meta-data-spring-boot.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","datePublished":"2016-01-14T11:00:29+00:00","description":"There were many updates released in the Spring Boot 1.3.0 but one of them stood out to me because I was not aware of this before and the state it got to","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2016\/01\/pimp-config-configuration-meta-data-spring-boot.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2016\/01\/pimp-config-configuration-meta-data-spring-boot.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2016\/01\/pimp-config-configuration-meta-data-spring-boot.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","width":150,"height":150,"caption":"spring-interview-questions-answers"},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2016\/01\/pimp-config-configuration-meta-data-spring-boot.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Pimp your config with configuration meta-data in Spring Boot"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/2927b40b7959304127862052f0a267ab","name":"Jakub Stas","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0702ca1cf6a3bcd1926cba7c5b1d9a17b016a8cff098389e8f5f1cd22837a1c6?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0702ca1cf6a3bcd1926cba7c5b1d9a17b016a8cff098389e8f5f1cd22837a1c6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0702ca1cf6a3bcd1926cba7c5b1d9a17b016a8cff098389e8f5f1cd22837a1c6?s=96&d=mm&r=g","caption":"Jakub Stas"},"sameAs":["http:\/\/jakubstas.com\/","https:\/\/www.linkedin.com\/in\/jakubstas","https:\/\/x.com\/jakub_stas"],"url":"https:\/\/www.javacodegeeks.com\/author\/jakub-stas"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/51010","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/569"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=51010"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/51010\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/240"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=51010"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=51010"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=51010"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}