json-schema-org/json-schema-org.github.io

Unable to follow the redirection as URL https://json-schema.org/schema# responds a HTTP 200 code and a HTML document

t83714 opened this issue · 1 comments

Currently, URL https://json-schema.org/schema# responds:

  • an HTTP 200 code and
  • an HTML document with <meta http-equiv="refresh" content="0; url=/draft/2019-09/schema"> to redirect request to the latest schema

Most HTTP client lib cannot follow the redirection link in the tag which cause trouble of determining what's the latest schema version should be used.

Could we make URL https://json-schema.org/schema# respond a 302 http code and a Location: /draft/2019-09/schema header for the redirection?

@t83714 unfortunately GitHub pages does not allow this. We are working on getting better hosting, and will fix this then.

For now, the unversioned URIs are no longer official URIs and are not supported (and in fact have never been part of the normative specification). They have caused problems at each new draft publication. Given the limitations we're working with right now, we determined that having the unversioned URIs fail in an obvious unusable way was preferable to having them return something that kind of sort of looks right but is actually the "wrong" resource.

Note that per the spec, meta-schemas SHOULD NOT be automatically fetched each time they are encountered. Clients are expected to cache the actual file locally. Conforming implementations will not encounter this problem regularly.