# Validate a Serializable input
fun validate_json(json: Serializable): Bool do
if not json isa JsonObject then
validation.add_error("document", "Expected JsonObject got `{json.class_name}`")
return false
end
validation.object = json
for validator in validators do
var res = validator.validate_field(self, json)
if not res then return false
end
return true
end
lib/popcorn/pop_validation.nit:196,2--208,4