How to treat the "description" field on a toggle.
How to treat the "description" field on a toggle.
Transforms the Toggle's "description" field into being empty.
Transforms the Toggle's "description" field into being empty.
This is useful for service owner overrides of a toggle where the developer making modifications is not the one who has defined the toggle itself.
Requires toggles to have a "description" field.
Requires toggles to have a "description" field.
This is useful for the library owner's base definitions of Toggle.
Serialize a ToggleMap to JSON format
Serialize a ToggleMap to JSON format
this is a helper for Java friendliness. Scala users should continue to
use toJson.
Attempts to parse the given JSON URL into a ToggleMap.
Attempts to parse the given JSON URL into a ToggleMap.
Useful for loading resource files via StandardToggleMap.
The JSON Schema used is:
{
"$schema": "https://json-schema.org/draft-04/schema#",
"type": "object",
"required": [
"toggles"
],
"properties": {
"toggles": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": { "type": "string" },
"description": { "type": "string" },
"fraction": {
"type": "number",
"minimum": 0.0,
"maximum": 1.0,
"exclusiveMinimum": false,
"exclusiveMaxmimum": false
},
"comment": { "type": "string" }
},
"required": [
"id",
"fraction"
]
}
}
}
}Here is an example of a JSON ToggleMap input:
{
"toggles": [
{
"id": "com.game.of.thrones.WargingEnabled",
"description": "Use warging for computing the response.",
"fraction": 0.1
},
{
"id": "com.game.of.thrones.IsWinterComing",
"description": "Controls whether or not winter is coming.",
"fraction": 1.0,
"comment": "We've seen the white walkers, we know that winter is coming."
}
]
}With the exception of "comment", the properties correspond to the various fields on Toggle.Metadata.
Toggle.Metadata.id.Toggle.Metadata.fraction and values must be
between 0.0 and 1.0, inclusive.Toggle.Metadata.description.how to treat the "description" field for a toggle.
Attempts to parse the given JSON String into a ToggleMap.
Attempts to parse the given JSON String into a ToggleMap.
The JSON Schema used is:
{
"$schema": "https://json-schema.org/draft-04/schema#",
"type": "object",
"required": [
"toggles"
],
"properties": {
"toggles": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": { "type": "string" },
"description": { "type": "string" },
"fraction": {
"type": "number",
"minimum": 0.0,
"maximum": 1.0,
"exclusiveMinimum": false,
"exclusiveMaxmimum": false
},
"comment": { "type": "string" }
},
"required": [
"id",
"fraction"
]
}
}
}
}Here is an example of a JSON ToggleMap input:
{
"toggles": [
{
"id": "com.game.of.thrones.WargingEnabled",
"description": "Use warging for computing the response.",
"fraction": 0.1
},
{
"id": "com.game.of.thrones.IsWinterComing",
"description": "Controls whether or not winter is coming.",
"fraction": 1.0,
"comment": "We've seen the white walkers, we know that winter is coming."
}
]
}With the exception of "comment", the properties correspond to the various fields on Toggle.Metadata.
Toggle.Metadata.id.Toggle.Metadata.fraction and values must be
between 0.0 and 1.0, inclusive.Toggle.Metadata.description.how to treat the "description" field for a toggle.
Serialize a ToggleMap to JSON format
ToggleMaps in JSON format.