Deserialize val from JSON for a parameter typed by static_type

Accepts String for convenience, but returns null when val == null.

This method is called by the code generated by nitrestful. It can be specialized to customize its behavior.

Property definitions

nitcorn $ RestfulAction :: deserialize_arg
	# Deserialize `val` from JSON for a parameter typed by `static_type`
	#
	# Accepts `nullable String` for convenience, but returns `null` when `val == null`.
	#
	# This method is called by the code generated by `nitrestful`.
	# It can be specialized to customize its behavior.
	protected fun deserialize_arg(val: nullable String, static_type: String): nullable Object
	do
		if val == null then return null

		var deserializer = new JsonDeserializer(val)
		var obj = deserializer.deserialize(static_type)

		if deserializer.errors.not_empty then
			print_error deserializer.errors.join("\n")
			return null
		end

		return obj
	end
lib/nitcorn/restful.nit:69,2--88,4