Fix boolean deserialization

master
Harald Wolff 2023-09-09 01:52:14 +02:00
parent e8cd08cb4c
commit fb6d4fdede
1 changed files with 1 additions and 1 deletions

View File

@ -446,7 +446,7 @@ namespace ln.json.mapping
DefaultMapper.Add(new JSONMapping(
typeof(bool),
(JSONMapper arg1, object arg2) => ((bool)arg2) ? (JSONValue)JSONTrue.Instance : (JSONValue)JSONFalse.Instance,
(JSONMapper arg1, JSONValue arg2) => (arg2.ValueType == JSONValueType.TRUE) || (arg2.ValueType == JSONValueType.FALSE) ? false : throw new NotSupportedException()
(JSONMapper arg1, JSONValue arg2) => (arg2.ValueType == JSONValueType.TRUE) ? true : false
));
DefaultMapper.Add(new JSONByteArrayMapping());