- # Accepted parameterized classes to deserialize
- #
- # If `whitelist.empty`, all types are accepted.
- #
- # ~~~nitish
- # import json::serialization
- #
- # class MyClass
- # serialize
- # end
- #
- # var json_string = """
- # {"__class" = "MyClass"}
- # """
- #
- # var deserializer = new JsonDeserializer(json_string)
- # var obj = deserializer.deserialize
- # assert deserializer.errors.is_empty
- # assert obj isa MyClass
- #
- # deserializer = new JsonDeserializer(json_string)
- # deserializer.whitelist.add "Array[String]"
- # deserializer.whitelist.add "AnotherAcceptedClass"
- # obj = deserializer.deserialize
- # assert deserializer.errors.length == 1
- # assert obj == null
- # ~~~
- var whitelist = new Array[Text]
-
- # Should objects be checked if they a subtype of the static type before deserialization?
- #
- # Defaults to `true`, as it should always be activated.
- # It can be turned off to implement the subtype check itself.
- var check_subtypes = true is writable
-