Skip to content

Commit

Permalink
follow PR comment
Browse files Browse the repository at this point in the history
  • Loading branch information
SentryMan committed Apr 25, 2024
1 parent ce77eb4 commit d9e6a98
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ public void install(Jooby application) throws Exception {
.forEach(
e -> {
final var key = e.getKey();
beanScope.provideDefault(key.getName(), key.getType(), e.getValue()::get);
if (key.getName() == null) {
beanScope.provideDefault(key.getType(), e::getValue);
} else {
beanScope.bean(key.getName(), key.getType(), e.getValue());
}
});
final var environment = application.getEnvironment();
beanScope.profiles(environment.getActiveNames().toArray(String[]::new));
Expand Down

0 comments on commit d9e6a98

Please sign in to comment.