Description
Description of the feature / enhancement.
Me and @madskristensen have been discussing how to improve the hosting. We're looking to move towards hosting that more leverages GitHub to improve reliability. There are a few proposals:
Proposal 1
In catalog.json
, swap all https://json.schemastore.org/*
with https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/*
URLs.
Proposal 2
Create extra GitHub repositories for every subdomain needed (limitation of GitHub). For each of these repositories, publish to GitHub actions and configure the schemastore.org
DNS servers (through a CNAME
record) to:
-
"Direct"
json.schemastore.org
requests to the GitHub Pages ofSchemaStore/schemastore
. On every commit onmaster
, we can run an action that publishes to GitHub Pages. Must copy schemas so each one is available at, for example/ava.json
and/ava
-
"Direct"
www.schemastore.org
requests to the GitHub Pages of (the new)SchemaStore/schemastore-www
. The catalog is hosted atwww.schemastore.org/api/json/catalog.json
, so for every change incatalog.json
onmaster
inSchemaStore/schemastore
, it will need to be copied (and committed) over -
"Direct"
schemastore.org
requests to the GitHub Pages of (the new)SchemaStore/schemastore-apex
. This repository either:
- A. Has the same content as
www.schemastore.org
- B. Has HTML redirects for all the routes under
www.schemastore.org
- C. Has an HTML redirect for only
schemastore.org/index.html
- D. Same as C, but also a copy (no redirect) of
api/json/catalog.json
It's not uncommon to omit the www
part of URLs (I certainly do). The old site automatically added www
to everything, but that can't be done server-side anymore. I'm learning towards C or D. This apex URL is used in the wild and users currently have the expectation that going to schemastore.org
will show the up-to-date site. catalog.json
can also be copied over, but I poked around at a few projects with links to the catalog, and they all use URLs with the www
subdomain.
Implementation Timeline
Phase A:
- Create
schemastore-{www,apex}
GitHub repositories - For all three repositories, set
Settings > Pages > Build and deployment > Source
to "GitHub Actions" - Add configuration/code to all three repositories to get the desired behavior
Phase B:
- For all three repositories, hook up GitHub pages with DNS for a testing domain
- Edit DNS records for
schemastore.org
, wait at least the TTL, then tell GitHub to useschemastore.org
Proposal 3
-
Do Proposal 1
-
But also "Direct"
json.schemastore.org
requests to the GitHub Pages ofSchemaStore/schemastore
(no extra repositories)
Summary
Proposal 1 is much simpler. But proposal 2 covers nearly all uses of SchemaStore (including direct reference like "$schema": "https://json.schemastore.org/ava.json"
). Proposal 2 won't break the implicit contract that json.schemastore.org
links are always up to date. I also noticed that both will allow schemas to be transferred over HTTP/2 (thanks to GitHub).
Proposal 1 is simpler and follows the original intent of the catalog. Proposal 2 does a lot of work to be very backwards-compatible, but is too complex. Proposal 3 is a hybrid approach that attempts to follow the original intent of the catalog, but also keeps json.schemastore.org/*
URLs up to date for current consumers that access it directly.
Are you making a PR for this?
Yes