geozarr-spec icon indicating copy to clipboard operation
geozarr-spec copied to clipboard

Provide JSON schema for the spec?

Open TomAugspurger opened this issue 7 months ago • 1 comments

Inspired by https://github.com/zarr-developers/geozarr-spec/issues/68, would folks be open to adding a json schema schema to the repo? It's very helpful to have a somewhat authoritative statement of whether some collection of JSON documents comply with the spec.

There will be some subtleties of the spec that can't be captured by JSON schema (either because they're outside of JSON, or json schema isn't expressive enough to model the spec).

If people are open to this, I can take a first pass at it this week.

TomAugspurger avatar May 31 '25 17:05 TomAugspurger

+1000 to json schemas. I would love to be more involved with building geozarr examples from TIFF/COG. The current blocker is I'm not totally sure what I should be building against. JSON schemas would help greatly, even if they aren't "perfect" to start.

geospatial-jeff avatar May 31 '25 17:05 geospatial-jeff

Closing as stale. No recent activity and likely no longer relevant. Can be reopened if needed.

christophenoel avatar Oct 31 '25 09:10 christophenoel

Do you want JSON schema?

TomAugspurger avatar Oct 31 '25 11:10 TomAugspurger

Could you clarify which JSON document you wish to represent in JSON schema ?

christophenoel avatar Oct 31 '25 12:10 christophenoel

How familiar are you with JSON schema @christophenoel? The basic idea is to provide a schema that JSON objects can be validated against.

In this case, the JSON objects would be the Zarr metadata (zarr.json in zarr v3 terminology, if writing to disk) and the properties to validate would be the fields added by the GeoZarr spec. The schemas are extremely useful for both producers and consumers.

TomAugspurger avatar Oct 31 '25 13:10 TomAugspurger

I'm very familiar with JSON schema but GeoZarr metadata is any Zarr metadata. We only defined now "multiscales" as additional schema, and the schema is provided in the related section.

christophenoel avatar Oct 31 '25 13:10 christophenoel

but GeoZarr metadata is any Zarr metadata.

Sorry, I don't follow what you mean.

If it's that the GeoZarr metadata is a subset of the Zarr metadata, that's fine. JSON schema lets you define schemas for specific properties and ignore others.

We only defined now "multiscales" as additional schema, and the schema is provided in the related section.

Oh great, where's that at? My search isn't finding it. Or by schema, do you mean https://github.com/zarr-developers/geozarr-spec/blob/main/standard/template/sections/clause_9_zarr_encoding_overviews.adoc#metadata-encoding?

Again, from experience, being able to validate that with a tool is valuable.

TomAugspurger avatar Oct 31 '25 13:10 TomAugspurger