ietf-wg-httpapi / mediatypes

Other
5 stars 4 forks source link

Fix: #7. Add jsonschema #14

Closed ioggstream closed 2 years ago

ioggstream commented 2 years ago

This PR

Notes

@relequestual @jasondesrosiers

Relequestual commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

jdesrosiers commented 2 years ago

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 commented 2 years ago

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.

:+1:

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

:+1: waitforit

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

it's already in this PR, so :heavy_check_mark:

richsalz commented 2 years ago

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

ioggstream commented 2 years ago

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

Pls see #18

richsalz commented 2 years ago

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

jdesrosiers commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

@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 commented 2 years ago

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 commented 2 years ago

@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 commented 2 years ago

this thread will vanish once the PR will be merged

Do you mean closed as opposed to vanished?

ioggstream commented 2 years ago

Closed in favor of #19