diff --git a/docs/src/main/asciidoc/application-configuration-guide.adoc b/docs/src/main/asciidoc/application-configuration-guide.adoc index 57399be742774..4b0044d42a619 100644 --- a/docs/src/main/asciidoc/application-configuration-guide.adoc +++ b/docs/src/main/asciidoc/application-configuration-guide.adoc @@ -63,19 +63,18 @@ Edit the `org.acme.config.GreetingResource`, and introduce the 3 following confi [source,java] ---- -@Inject @ConfigProperty(name = "greeting.message") private String message; -@Inject @ConfigProperty(name = "greeting.suffix", defaultValue="!") private String suffix; -@Inject @ConfigProperty(name = "greeting.name") private Optional name; ---- +NOTE: The `@Inject` annotation is not strictly necessary from members annotated with `@ConfigProperty`, a behavior which differs from https://microprofile.io/project/eclipse/microprofile-config[MicroProfile Config] + If you do not provide a value for the first property, it will have a `null` value. The second property injects the given default value if the configuration file does not provide a value. The third property is optional. The injected `Optional` is empty as the configuration file does not provide a value. @@ -189,4 +188,4 @@ NOTE: Environment variables names are following the conversion rules of link:htt There are converters that convert your property file content from `String` to typed Java types. See the list link:https://github.com/eclipse/microprofile-config/blob/master/spec/src/main/asciidoc/converters.asciidoc[in the specification]. -// TODO: make Ken review this section and discuss SmallRye expansion. \ No newline at end of file +// TODO: make Ken review this section and discuss SmallRye expansion. diff --git a/docs/src/main/asciidoc/health-guide.adoc b/docs/src/main/asciidoc/health-guide.adoc index bd4a91618df02..b1eeca00e74ea 100644 --- a/docs/src/main/asciidoc/health-guide.adoc +++ b/docs/src/main/asciidoc/health-guide.adoc @@ -170,7 +170,6 @@ import javax.inject.Inject; @ApplicationScoped public class DatabaseConnectionHealthCheck implements HealthCheck { - @Inject @ConfigProperty(name = "database.up", defaultValue = "false") private boolean databaseUp;