question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support multiple JSON Schema Validator Backends?

See original GitHub issue

As implicitly acknowledged in #46, validating against the JSON schema is expensive, slow, and when running things at scale, really making me think about skipping it, which is a red flag. If I’m thinking about bailing on validation, others aren’t far behind me.

I did a little digging, and it seems this is more a function of jsonschema being slow than schema validation being inherently slow. For example, this: https://github.com/epoberezkin/ajv#performance

Couple thoughts:

  • I recognize that these are not Python libraries, but it demonstrates the variability in validator performance.
  • The fastest one has a command line interface that we could consider wrapping. This wouldn’t (and shouldn’t) be the default validator, but multiple backends could allow for more flexible validator support.
  • There don’t actually seem to be many “native” options for JSON schema validation in Python, so wrapping one in another language might be simplest way to speed this up.

thoughts? complete heresy?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:15 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
ejhumphreycommented, Sep 5, 2017

Ya, to be perfectly clear, I also don’t want to dabble in subcomponent / arbitrary JObject validation … but I think it might make sense to do this at the Annotation level rather than a Jams object, since the former tend to be more like documents, and the latter more like containers.

as for profiling … I read Jams files far more than I write / modify them, so therefore the majority of my time validating Jams files is wasted (converging to “all of my time” as t -> inf). 😄

0reactions
bmcfeecommented, Oct 3, 2017

Is there any reason to keep this open, or can we close it out as a non-fixer?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Implementations - JSON Schema
Support for large data and streaming validation. ... Notes: can be used with YAML and many other formats besides JSON; Information last updated:...
Read more >
support multiple json files · Issue #11 - GitHub
Yes. It supports multiple files; however, you cannot refer to your local file system as in JSON schema spec, the $ref is a...
Read more >
The Many Amazing Uses of JSON Schema: Client-side ...
The idea is that validation rules should be written down somewhere, and not just inside the backend code. If the validation rules can...
Read more >
JSON-Schema everywhere. How to make web development ...
Backend Validation in a Node.js-Middleware · Initialize AJV and load the Schemas. · Define your middleware which uses the validate-method to check the...
Read more >
Guide: Setting up JSON validation - Interoperability Test Bed
An JSON validation service can be created using multiple approaches depending on your needs. You can have an on-premise (or local to your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found