Skip to content

Generic JSON input #239

@Stranger6667

Description

@Stranger6667

At the moment, jsonschema supports only serde_json, which is convenient, but implies significant overhead in some cases. For example, in Python bindings, I got to convert Python structures to serde_json::Value first and this conversion takes up to 85% of the overall validation time. It will be much faster if those Python objects will be used directly without conversion.

It could be done with a generic Json trait that will implement some API on the input data (likely similar to serde_json). In this case, implementing Json on a newtype wrapper around PyAny will eliminate the need for conversion. Additionally, it will reduce the memory footprint as no copying will be needed.

For existing serde_json data it should be optimized away as the wrapper will just delegate the calls to serde_json::Value.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions