Skip to content

Question: Why is stringification not a valid conversion action before validating an object? #287

@XSven

Description

@XSven

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?

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions