hubverse-org / schemas

JSON schemas for modeling hubs
Creative Commons Zero v1.0 Universal
4 stars 2 forks source link

Ensure `$schema` properties start with `http` not `https` #44

Closed annakrystalli closed 11 months ago

annakrystalli commented 1 year ago

URLs which start with https are not recognised by ajv causing issues when using other validators like ajv-cli. So all URLs in $schema properties specified the json schema version should start with http.

See issues brought up in #42

annakrystalli commented 12 months ago

So I looked into this a bit.

Firstly, it already works for us through jsonvalidate R package and when I looked at the json-schema.org docs on declaring a JSON schema, the example uses https 🤷‍♀️

image

It looks like this is an ajv issue (e.g. see here which emanates from the fact that that ajv bundles the meta schema up, treats the $schema property an identifier to a bundled file (it is not retrieved from the net) and does not recognise https.

So I wasn't sure whether to bother with this as it doesn't affect our workflow. But given it may make the schema files more interoperable with other validation tools, I'll go ahead and implement it.

annakrystalli commented 12 months ago

Oddly, shifting to http now causes the same error when using jsonvalidate in R 🤷‍♀️

image

https://github.com/Infectious-Disease-Modeling-Hubs/schemas/actions/runs/5540256450/jobs/10112113732?pr=59

annakrystalli commented 12 months ago

Reverted. Not going to fix this because it breaks the jsonvalidate workflow