Implement structure type feature flag client #4
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
Implement conversion to
Value
, supportingStructure
type feature flag value.close #3
How
Expecting JSON format string value in
flag_value
.Because of AWS AppConfig feature flag schema limitation (flag value cannot be nested), the spec for structure-type feature flag in this provider implementation is putting JSON string to
flag_value
attribute.JSON
Structure
could be nested object. The value might be primitive like A, or nested JSON like B.So, the logic is converting feature flag string value to
JsonNode
, and then walk through DFS-ly and build nestedValue
. This isAppConfigParser#convertJsonNodeAsValueRecursively
implementation.See example in tests in
AppConfigParserTest.ConvertJsonNodeAsValueRecursively
class.Note
This might confusing because some case might exist that geting feature flag value as structure unexpectedly, not as string.
But, this might never happen.
For example, some Application Authors want to get feature flag value as string (
A
in above example), not as structure.In this case, they will call Evaluation API with
getStringValue
. So, type mismatching will not occur.Notes
N/A