snowplow / iglu

Iglu is a machine-readable, open-source schema repository for JSON Schema from the team at Snowplow
http://www.snowplow.io
Apache License 2.0
208 stars 45 forks source link

QUESTION: how self-describe json relates to json-schemas? #503

Closed tatitati closed 4 years ago

tatitati commented 4 years ago

Sorry for the question, I know that iglu-client is trying to add JSON Schema Draft v7 support (https://github.com/snowplow/iglu/issues/303), however in iglu-client i can read that it "Only support Self-describe json." This bring me some questions:

Sorry for the bunch of questions, is something I couldn't read in the doc so far.

Thanks a lot

chuwy commented 4 years ago

Hey @tatitati! Thanks for your interest!

First, I'd like to address some confusion (which I also had when first stumbled upon Iglu). There are two tightly coupled, but totally opposite kinds of entities:

  1. Self-describing JSONs (example). Plain payload that claim that it is valid against some JSON Schema (using schema keyword, not $schema).
  2. Self-describing JSON Schemas (example). Plain JSON Schema that has attached meta-data (using self keyword).

These two kinds of entities are tightly coupled and meant to be used together. From schema key in JSON you know what schema you need to use to validate (and do more cool stuff) it. So data always refer to schema.

So to actually address your questions:

Is self-describe-json superseeding json-schema or adding new features like a wrapper?

Self-describing JSONs do neither, but Self-describing shcmeas do latter

why not using json-schema which seems to be the standard?

We are using it, complying all standards (see meta-schema)

tatitati commented 4 years ago

Thanks a lot @chuwy for the great answer, it was really helpful. Also I will close the question, I have all the information I need.

Thanks!