Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove now unnecessary @Inject on @ConfigProperty #1560

Merged
merged 1 commit into from
Mar 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions docs/src/main/asciidoc/application-configuration-guide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> 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.
Expand Down Expand Up @@ -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.
// TODO: make Ken review this section and discuss SmallRye expansion.
1 change: 0 additions & 1 deletion docs/src/main/asciidoc/health-guide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ import javax.inject.Inject;
@ApplicationScoped
public class DatabaseConnectionHealthCheck implements HealthCheck {
@Inject
@ConfigProperty(name = "database.up", defaultValue = "false")
private boolean databaseUp;
Expand Down