Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
return null
end
- redef fun deserialize
+ redef fun deserialize(static_type)
do
errors.clear
# Current array open for deserialization, used by `SimpleCollection::from_deserializer`
private var opened_array: nullable Array[nullable Object] = null
- redef fun deserialize
+ redef fun deserialize(static_type)
do
errors.clear
- return convert_object(root)
+ return convert_object(root, static_type)
end
# User customizable heuristic to infer the name of the Nit class to deserialize `json_object`
abstract class Deserializer
# Deserialize and return an object, storing errors in the attribute `errors`
#
+ # If a `static_type` is given, only subtypes of the `static_type` are accepted.
+ #
# This method behavior varies according to the implementation engines.
- fun deserialize: nullable Object is abstract
+ fun deserialize(static_type: nullable String): nullable Object is abstract
# Deserialize the attribute with `name` from the object open for deserialization
#