Skip to content
This repository was archived by the owner on Nov 2, 2023. It is now read-only.

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

Closed
t83714 opened this issue Nov 13, 2019 · 1 comment

Comments

@t83714
Copy link

t83714 commented Nov 13, 2019

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 t83714 changed the title URL https://json-schema.org/schema# responds a HTTP 200 code and a HTML document Unable to follow the redirection as URL https://json-schema.org/schema# responds a HTTP 200 code and a HTML document Nov 13, 2019
@handrews
Copy link
Contributor

@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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants