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

fix: Handle null section as a request for the entire configuration object #545

Merged
merged 2 commits into from
Sep 27, 2024
Merged
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,16 @@ public CompletableFuture<List<Object>> configuration(ConfigurationParams params)
* must return an instance of {@link JsonObject} but this method can be overridden to return another structure.
* </p>
*
* @param section the section.
* @return the settings retrieved by the given section and null otherwise.
* @param section the section. In the base implementation, a null section indicates a request for the entire
* settings object.
* @return the settings retrieved by a valid section and null otherwise.
*/
protected Object findSettings(String section) {
bzoracler marked this conversation as resolved.
Show resolved Hide resolved
var config = createSettings();
if (config instanceof JsonObject json) {
if (section == null) {
return config;
}
String[] sections = section.split("[.]");
return findSettings(sections, json);
}
Expand Down
Loading