generated from micronaut-projects/micronaut-project-template
-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Labels
Description
Expected Behavior
The config documentation configuration here specifies micronaut.object-storage.aws.enabled as a boolean flag, and it defaults to true. So setting this as true in the YAML, such as:
micronaut:
object-storage:
aws:
default:
bucket: "a.bucket.location"
enabled: true
Should be the same as omitting it, such as:
micronaut:
object-storage:
aws:
default:
bucket: "a.bucket.location"
Actual Behaviour
Setting the value as true in the YAML results in two AwsS3Operations beans being in scope for creation - one named "default", and one malformed one named "enabled" that has invalid configuration associated with it.
Steps To Reproduce
- set YAML config to include:
micronaut:
object-storage:
aws:
default:
bucket: "a.bucket.location"
enabled: true
- Copying the existing AwsS3Operations bean class, and mark it with @context for eager initialisation at startup, i.e.
@Context
@EachBean(AwsS3Configuration.class)
@Requires(condition = ToggeableCondition.class)
@Requires(beans = AwsS3Configuration.class)
@Replaces(AwsS3Operations.class)
public class AwsS3OperationsNew implements ObjectStorageOperations<
PutObjectRequest.Builder, PutObjectResponse, DeleteObjectResponse> {
...rest of class here...
- Set a breakpoint in the constructor of the new class, and start the application. The constructor will be called twice, with one invocation including a malformed configuration bean argument named "enabled"
Environment Information
No response
Example Application
No response
Version
4.3.1