Mojo::JSON tries to apply either TO_JSON or stringification (in order) when encoding an object (blessed reference). JSON::Validator::Schema::_validate() does
local $_[1] = $data->TO_JSON if blessed $data and $data->can('TO_JSON');
but ignores the possibility that $data is blessed and has stringification implemented.
Why is stringification not considered?
Mojo::JSONtries to apply eitherTO_JSONorstringification(in order) when encoding an object (blessed reference).JSON::Validator::Schema::_validate()doeslocal $_[1] = $data->TO_JSON if blessed $data and $data->can('TO_JSON');but ignores the possibility that
$datais blessed and hasstringificationimplemented.Why is
stringificationnot considered?