You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I then have another Interface which defines my configuration object that will be used in my Quarkus Project. It defines T as an Enum which implements the interface above.
I am currently implementing my library into my project, but I am getting various errors around configuration mapping. I have defined the configuration. My implementation of the ErrorCode is below.
public enum TestExceptionCode implements ErrorCode {
ERROR_ONE("Error1", "Test Exception Code",
SeverityResult.REJECT, Map.of(VALIDATION_LEVEL, ValidationLevel.NONE, TAG, Tag.of(ApplicationMetrics.TYPE, "MF001")));
private final String code;
private final String description;
private final SeverityResult severityResult;
private final Map<String, Object> additionalProperties;
TestExceptionCode(final String code, final String description, final SeverityResult severityResult, final Map<String, Object> additionalProperties) {
this.code = code;
this.description = description;
this.severityResult = severityResult;
this.additionalProperties = additionalProperties;
}
@Override
public String code() {
return this.code;
}
@Override
public String description() {
return this.description;
}
@Override
public SeverityResult severity() {
return this.severityResult;
}
@Override
public Map<String, Object> additionalProperties() {
return this.additionalProperties;
}
}
And then I have a configuration Interface that is defined as
@ConfigMapping(prefix = "validation.rules.test")
public interface TestConfiguration {
RuleConfiguration<TestExceptionCode> testErrorOne();
}
And configuration in YAML format as below
validation:
rules:
test:
test-error-one:
name: Test Error One
description: A Friendly Description
rule-order: 0
continue-on-failure: true
additional-properties:
property-one:
- LGIM_TCS
property-two:
- NONE
exception-code: ERROR_ONE
Now once I run the application, I am getting the below errors related to the Configuration java.lang.IllegalArgumentException: SRCFG00013: No Converter registered for interface com.lgim.configuration.RuleConfiguration
Expected behavior
I expect the Configuration to map to my object
Actual behavior
Configuration fails to map and produces an error
How to Reproduce?
Steps above should be enough to reproduce. If it isn't enough I will try and find some time to create a reproducer
Output of uname -a or ver
Linux LG39016415 5.15.153.1-microsoft-standard-WSL2 #1 SMP Fri Mar 29 23:14:13 UTC 2024 x86_64 GNU/Linux
Output of java -version
openjdk version "21.0.4" 2024-07-16 OpenJDK Runtime Environment (Red_Hat-21.0.4.0.7-2) (build 21.0.4+7) OpenJDK 64-Bit Server VM (Red_Hat-21.0.4.0.7-2) (build 21.0.4+7, mixed mode, sharing)
Quarkus version or git rev
3.12.1
Build tool (ie. output of mvnw --version or gradlew --version)
Apache Maven 3.9.1 (Red Hat 3.9.1-3) Maven home: /usr/share/maven Java version: 21.0.4, vendor: Red Hat, Inc., runtime: /usr/lib/jvm/java-21-openjdk-21.0.4.0.7-2.fc39.x86_64 Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "5.15.153.1-microsoft-standard-wsl2", arch: "amd64", family: "unix"
Currently, we don't support generic declarations in the config interface. It is not impossible to add it, but it does require a considerable amount of effort. Until now, we have never had users ask for it.
Honestly, I don't think this is a top priority. If someone wants to work in this, I'm happy to help review the PR.
Describe the bug
I have created an external library which defines an Interface as below which is expected to be implemented by different enum classes.
I then have another Interface which defines my configuration object that will be used in my Quarkus Project. It defines T as an Enum which implements the interface above.
I am currently implementing my library into my project, but I am getting various errors around configuration mapping. I have defined the configuration. My implementation of the ErrorCode is below.
And then I have a configuration Interface that is defined as
And configuration in YAML format as below
Now once I run the application, I am getting the below errors related to the Configuration
java.lang.IllegalArgumentException: SRCFG00013: No Converter registered for interface com.lgim.configuration.RuleConfiguration
Expected behavior
I expect the Configuration to map to my object
Actual behavior
Configuration fails to map and produces an error
How to Reproduce?
Steps above should be enough to reproduce. If it isn't enough I will try and find some time to create a reproducer
Output of
uname -a
orver
Linux LG39016415 5.15.153.1-microsoft-standard-WSL2 #1 SMP Fri Mar 29 23:14:13 UTC 2024 x86_64 GNU/Linux
Output of
java -version
openjdk version "21.0.4" 2024-07-16 OpenJDK Runtime Environment (Red_Hat-21.0.4.0.7-2) (build 21.0.4+7) OpenJDK 64-Bit Server VM (Red_Hat-21.0.4.0.7-2) (build 21.0.4+7, mixed mode, sharing)
Quarkus version or git rev
3.12.1
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.9.1 (Red Hat 3.9.1-3) Maven home: /usr/share/maven Java version: 21.0.4, vendor: Red Hat, Inc., runtime: /usr/lib/jvm/java-21-openjdk-21.0.4.0.7-2.fc39.x86_64 Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "5.15.153.1-microsoft-standard-wsl2", arch: "amd64", family: "unix"
Additional information
No response
code-with-quarkus.zip
Edit: Added a reproducer project
The text was updated successfully, but these errors were encountered: