Convert config key to map<string, String> and provide custom unmarsha…#2523
Open
clun wants to merge 1 commit into
Open
Convert config key to map<string, String> and provide custom unmarsha…#2523clun wants to merge 1 commit into
clun wants to merge 1 commit into
Conversation
…lling of features
Contributor
📈 Unit Test Coverage Delta vs Main Branch
|
Contributor
Unit Test Coverage Report
|
Contributor
📈 Integration Test Coverage Delta vs Main Branch (dse69-it)
|
Contributor
Integration Test Coverage Report (dse69-it)
|
Contributor
📈 Integration Test Coverage Delta vs Main Branch (hcd-it)
|
Contributor
Integration Test Coverage Report (hcd-it)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What This PR Does
This PR resolves a configuration mismatch when setting API feature flags via environment variables.
Previously, feature flags whose enum names contained underscores (for example,
BILLING_EVENTS_LOGGING) could not be configured correctly through environment variables. This occurred because SmallRye Config automatically translates underscores (_) to dots (.), which conflicted with the existing enum-to-string conversion logic.By changing feature flag configuration keys from enum types to strings at the configuration boundary and performing explicit conversion at runtime, both property-based and environment-variable-based configuration now work consistently.
Related Issue
Fixes #2506
Changes
1.
FeaturesConfig.javaChanged the configuration mapping from:
to:
Added comprehensive JavaDoc documentation covering:
Added configuration examples for both approaches
2.
ApiFeatures.javamarshallFromConfig(Map<String, String>)to convert configuration keys toApiFeatureenumsfindFeatureByName(String)helper method to support kebab-case feature flag lookupMap<String, String>and perform explicit marshalling3.
BillingTest.java"billing-events-logging") instead of enum valuesConfiguration Examples
Property File (
application.yaml)Environment Variables
Checklist