JsonDynamicConfigurationProvider
A dynamic configuration provider loads values from an asset configuration file.
The configuration file has JSON format and is named after a configuration group. It is read once at the first request of a value of a configuration group.
Configuration file schema
The configuration file contains a configuration version and an array of configuration values. Each value consists of a name and an array of versioned values. The latter has a value, a version it applies to, and an update strategy for any existing values.
The parser ignores incorrect data, like:
A configuration version that is less than DynamicConfigurationValue.BASE_VERSION.
A value's version that is less than DynamicConfigurationValue.BASE_VERSION or greater than the configuration version.
Missing name, version, or update strategy fields.
Example
{
"version": 3,
"configuration": [
{
"name": "exampleServiceIsEnabled",
"description": "Optional field: a configuration description.",
"values": [
{
"value": true,
"fromVersion": 1,
"updateStrategy": "always"
},
{
"value": false,
"fromVersion": 2,
"updateStrategy": "defaultOnly"
}
]
},
{
"name": "integerValue",
"values": [
{
"value": 42,
"fromVersion": 2,
"updateStrategy": "defaultOnly"
}
]
}
]
}