Closed rimutaka closed 3 years ago
Closes #13
JsonArray
Specifying the JSON type is a 2-level enum.
It used to be just JsonType::AlwaysString. Now the type has to be wrapped into JsonArray like this: JsonArray::Infer(JsonType::AlwaysString))
JsonType::AlwaysString
JsonArray::Infer(JsonType::AlwaysString))
Before:
let conf = Config::new_with_defaults() .add_json_type_override("/a/@attr1", JsonType::AlwaysString) .add_json_type_override("/a/b/@attr1", JsonType::AlwaysString) .add_json_type_override("/a/b", JsonType::AlwaysString);
After:
let conf = Config::new_with_defaults() .add_json_type_override("/a/@attr1", JsonArray::Infer(JsonType::AlwaysString)) .add_json_type_override("/a/b/@attr1", JsonArray::Infer(JsonType::AlwaysString)) .add_json_type_override("/a/b", JsonArray::Infer(JsonType::AlwaysString));
It's not a big change. I fixed the existing code with a single global search and replace.
Apart from the built-in tests it has been running in PROD for a couple of weeks.
@AlecTroemel , Alec, please, take a look if you have a minute.
LGTM!
Closes #13
Changes
Breaking changes
JsonArray
enum to specify if a node should always be an arraySpecifying the JSON type is a 2-level enum.
It used to be just
JsonType::AlwaysString
. Now the type has to be wrapped intoJsonArray
like this:JsonArray::Infer(JsonType::AlwaysString))
Before:
After:
It's not a big change. I fixed the existing code with a single global search and replace.
Testing
Apart from the built-in tests it has been running in PROD for a couple of weeks.
@AlecTroemel , Alec, please, take a look if you have a minute.