Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

schema.gsd.id Cloudflare Worker for schema $refs #177

Closed
joshbuker opened this issue Mar 28, 2023 · 7 comments
Closed

schema.gsd.id Cloudflare Worker for schema $refs #177

joshbuker opened this issue Mar 28, 2023 · 7 comments
Assignees
Labels
data format tooling Any code / tooling related issues

Comments

@joshbuker
Copy link
Member

Allow validators to resolve even if the source returns text/plain

Transparent pull and reserve with proper content type.

@joshbuker joshbuker added tooling Any code / tooling related issues data format labels Mar 28, 2023
@kurtseifried
Copy link
Contributor

schema.gsd.id/DOMAIN/SCHEMA-NAME.json (latest) or SCHEMA-NAME-1.2.3.json correct?

so e.g. schema.gsd.id/osv.dev/osv-1.5.0.json or schema.gsd.id/gsd.id/osv-gsd-1.0.0.json

16:42

@joshbuker
Copy link
Member Author

I would be tempted to do a slightly different encoding, but that works, yes.

Alternative idea: https://schema.gsd.id/DOMAIN/SCHEMA-NAME/version

e.g.
https://schema.gsd.id/osv.dev/osv/latest
https://schema.gsd.id/osv.dev/osv/1.5.0
https://schema.gsd.id/gsd.id/osv-gsd/1.0.0

@kurtseifried
Copy link
Contributor

I think your way is better. So I'll do that. Also for content type we'll use: application/schema+json as per the draft spec:

https://json-schema.org/draft/2019-09/json-schema-core.html

@kurtseifried
Copy link
Contributor

Oh I remember why I wanted to do it my way, it can just be files in a directory attached to cloudflare pages.

@joshbuker
Copy link
Member Author

@kurtseifried
Copy link
Contributor

Ok as per discussion we went with human firendly and machine friendly layout:

For humans we have the files with the version number embedded, e.g.: gsd.id/osv-gsd/schema-osv-gsd-1.0.1.json

For computers we have the files in directories with the version number, e.g.: gsd.id/osv-gsd/1.0.1/schema.json

The latest version of the schema is in the root directory and called schema.json, e.g.: gsd.id/osv-gsd/schema.json

@kurtseifried
Copy link
Contributor

also I'm using cloudflare pages which serves the json as "application/json" (and doesn't seem to lead _headers rewrite it), to get the proper "application/schema+json" we'll need to use a cloudflare worker or something that allows control of the header. That's a future problem/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data format tooling Any code / tooling related issues
Projects
None yet
Development

No branches or pull requests

2 participants