Skip to content

Commit

Permalink
Implement feedback
Browse files Browse the repository at this point in the history
(cherry picked from commit c5a4776)
  • Loading branch information
ryandens authored and gsmet committed Feb 25, 2025
1 parent 8f73f4f commit 523b666
Showing 1 changed file with 2 additions and 24 deletions.
26 changes: 2 additions & 24 deletions docs/src/main/asciidoc/config-reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -97,32 +97,10 @@ property names together.
[source,properties]
----
# value cannot be left empty
quarkus.datasource."datasource-name".jdbc.url=value
# value can be left empty but must be supplied by another source at runtime (or be an optional)
quarkus.datasource."datasource-name".jdbc.url=
----
If the value is not known until runtime, the key name can still be provided using the `io.smallrye.config.WithKeys` annotation.
[source,java]
----
@ConfigMapping(prefix = "com.example")
public interface ExampleConfig {
@WithKeys(KeySupplier.class)
Map<String, String> deployments();
class KeySupplier implements Supplier<Iterable<String>> {
@Override
public Iterable<String> get() {
return List.of("fake-deployment-name-2", "fake-deployment-name-1");
}
}
}
----
However, a values for these keys **must** then be provided at runtime. Configuration key disambiguation is not supported for optional properties.
[source,bash]
----
EXPORT QUARKUS_DATASOURCE__DATASOURCE_NAME__JDBC_URL=jdbc:postgresql://localhost:5432/database
Expand Down

0 comments on commit 523b666

Please sign in to comment.