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

Fix: #7. Add jsonschema #14

Closed
wants to merge 1 commit into from
Closed

Fix: #7. Add jsonschema #14

wants to merge 1 commit into from

Conversation

ioggstream
Copy link
Collaborator

@ioggstream ioggstream commented Jan 26, 2022

This PR

  • adds application/json+schema application/json-instance+schema

Notes

@Relequestual @jasondesrosiers

@Relequestual
Copy link

Wondering if it might be worth not doing anything YAML related in a PR titled "Add JSON Schema".
Might be worth doing YAML related things in a separate PR? =]

@jdesrosiers
Copy link
Contributor

I'm not sure we need to register application/schema-instance+json. I'll raise the discussion on the JSON Schema Slack and see if anyone thinks it's worth keeping.

@ioggstream
Copy link
Collaborator Author

@jdesrosiers thanks, I just inherited it from the current jschema draft.

@jdesrosiers
Copy link
Contributor

We discussed this on Friday and here's what we decided.

YAML
@Relequestual's concern about yaml was adding an unnecessary complication to JSON Schema, but we talked about how it would be limited to a YAML subset that is compatible with JSON (just like with Open API and JSON-LD). It's not YAML Schema, it's JSON Schema encoded as YAML. Since the point of writing a JSON Schema in YAML is for human readability, it's not clear why it would be necessary to transport a JSON Schema encoded in YAML. Storing it locally in YAML and developing in YAML makes sense, but transporting in YAML doesn't makes sense. @Relequestual is going to reach out to the community to see if an application/schema+yaml media-type is something people actually want.

The schema media-type parameter
I'll try to keep a long story short. Originally, the schema parameter had only one URI. Recently, it was changed to allow a comma separated list of URIs. That wasn't well enough thought out and we ended up removing it, but it accidentally got left in the IANA Considerations sections. What we want to register is the original one-URI version of schema. I'll suggest the necessary changes on the PR some time this week.

The application/instance+schema media type
We decided we do want to include this media type.

@ioggstream
Copy link
Collaborator Author

Hi @jdesrosiers

YAML @Relequestual's concern about yaml was adding an unnecessary complication to JSON Schema, but we talked about how it would be limited to a YAML subset that is compatible with JSON (just like with Open API and JSON-LD).

Exactly

It's not YAML Schema, it's JSON Schema encoded as YAML.

Exactly.

Since the point of writing a JSON Schema in YAML is for human readability, it's not clear why it would be necessary to transport a JSON Schema encoded in YAML. Storing it locally in YAML and developing in YAML makes sense, but transporting in YAML doesn't makes sense.

One of the goal is to support schema development and catalogs. Filed in #18

@Relequestual is going to reach out to the community to see if an application/schema+yaml media-type is something people actually want.

👍

The schema media-type parameter
I'll suggest the necessary changes on the PR some time this week.

👍 waitforit

The application/instance+schema media type We decided we do want to include this media type.

it's already in this PR, so ✔️

@richsalz
Copy link

richsalz commented Feb 7, 2022

Who is using YAML. Is there a need to standardize it now ?

@ioggstream
Copy link
Collaborator Author

Who is using YAML. Is there a need to standardize it now ?

Pls see #18

@richsalz
Copy link

richsalz commented Feb 7, 2022

Okay, question answered. I'd like to see this brought up at the meeting and confirmed by the WG tho.

@jdesrosiers
Copy link
Contributor

Who is using YAML. Is there a need to standardize it now ?

@Relequestual is going to reach out to the community to see if an application/schema+yaml media-type is something people actually want/need.

@ioggstream
Copy link
Collaborator Author

Who is using YAML. Is there a need to standardize it now ?

@Relequestual is going to reach out to the community to see if an application/schema+yaml media-type is something people actually want/need.

Thanks! I filed #18 to track this YAML discussion even after this PR wilthout yaml will be merged :)

@Relequestual
Copy link

@Relequestual is going to reach out to the community to see if an application/schema+yaml media-type is something people actually want.

Done. I'll report back if I hear anything.
https://twitter.com/jsonschema/status/1492088903188332545

@stuartherbert
Copy link

JSON Schema is written as YAML, when it is embedded in OpenAPI Spec v3.1 files. That would seem to pass the 'media types MUST NO be given names incorporating suffixes for structured syntaxes they do not actually employ" test in RFC 6838?

I personally don't know anyone extracting that schema and publishing it as a standalone resource in YAML format today, mostly because OpenAPI Spec v3.1 adoption is still at an early phase (in the communities where I work).

But I can certainly see it happening in the future. I have done work for clients who required schema definitions to be published as standalone, addressable resources. Once folks are used to writing schemas in YAML (as part of OpenAPI Spec v3.1), I do expect them to ask for any extracted schema to also be published in YAML for ease of comparison / consistency.

HTH.

@ioggstream
Copy link
Collaborator Author

@stuartherbert thanks, same view here... but could you please file your comments under #18 because this thread will vanish once the PR will be merged :) Thx+++

@Relequestual
Copy link

this thread will vanish once the PR will be merged

Do you mean closed as opposed to vanished?

@ioggstream
Copy link
Collaborator Author

Closed in favor of #19

@ioggstream ioggstream closed this Feb 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants