Json-api: jsonapi schema $id property

Created on 19 Nov 2020  路  10Comments  路  Source: json-api/json-api

Hi,

noticed that the jsonapi schema does not have the $id property. just curious if that's intended design?

The reason for asking is that currently, to reference the spec in something like following, I would need to add an $id property to the jsonapi schema?

  "allOf": [
    {
      "$ref": "http://jsonapi.org/schema#/definitions/success"
    },
    {
      "$ref": "#/definitions/myDomainResponse"
    }
  ],

Most helpful comment

That might not be a bad call. I could happily update any schema to 2020-12 if ya'll would like.

(also, it's OAS 3.1.0, not 3.10, just for anyone looking back)

All 10 comments

Looks like the schema in this repo is massivley out of date :(

@gabesullice

Thanks for bringing this up @bill-okara. Would you like to help bring it up to date with a PR @paul-uz and/or @bill-okara?

(thanks for the ping @auvipy)

Hi,
thanks all for responding to this issue.

@gabesullice,

regarding updating the schema, actually need to clarify is there a schema for the current JSON:API spec v1.0?

There seems to be no schema in the v1.0 branch, but in the JSON:API site faq page (with v1.0 being the current version of the spec), there's a link to a schema

Is there a JSON Schema describing JSON:API?
Yes, you can find the JSON Schema definition at http://jsonapi.org/schema.

but both the schema in the JSON:API (v1.0?) faq link and the schema in the latest v1.1 branch seems to be IDENTICAL.

http://jsonapi.org/schema
https://github.com/json-api/json-api/blob/v1.1rc3/schema

So is the schema in this branch

https://github.com/json-api/json-api/blob/gh-pages/schema

for v1.1? (and there's no schema for v1.0? or?)

thanks!

Was coming to file this issue, and found it exists.
Unless we hear anything, I'm going to work out if the schema is v1.0 or some other version, as I'm required to do so for my day job.

I'll come back and update, hopefully before the end of the week.

As an aside, if we end up needing to update the schema, I'm happy to advise on any changes.
I'm rather proficient at JSON Schema work.

Thanks, @Relequestual! This project should really benefit from your JSON Schema expertise.

We definitely have a few issues to straighten out with our schema, starting with creating a new v1.1 schema. I'm pretty sure that the schema at the root is strictly 1.0. (cc @bill-okara)

_Edit: To be clear, the versions I mentioned above (1.0 and 1.1) are for JSON:API, not JSON Schema._

Thanks @Relequestual ,@dgeb!

@dgeb, regarding

... I'm pretty sure that the schema at the root is strictly 1.0

  • Should that (v1.0) schema be updated to include an $id? like
    "$id": "https://jsonapi.org/v1.0/schema",
    so that current v1.0 users can reference that schema?

Also, regarding creating a new (_JSON:API_) v1.1 schema,

  • would it make sense to update the _JSON Schema_ version to the latest 2020-12 too? i.e.
    from: "$schema": "http://json-schema.org/draft-06/schema#", to: "$schema": "http://json-schema.org/2020-12/schema#",
    Since the newly released OpenAPI 3.1.0 is in full alignment with _JSON Schema 2020-12_, that might help the integration of _JSON:API_ defined models in _OpenAPI_ document?

thanks again!

Once I have a fixed schema for JSON:API 1.0, I'm happy to share it.
I don't have time to do one for 1.1, as that would fall outside the remit of day job requirements, and I already have a lot of JSON Schema work to do outside of work right now 馃槄

It probably doesn't make sense to use 2020-12 quite yet, as implementations are few. 2019-09 is fine for now, or even draft-07.

Once I have a fixed schema for JSON:API 1.0, I'm happy to share it.
I don't have time to do one for 1.1, as that would fall outside the remit of day job requirements, and I already have a lot of JSON Schema work to do outside of work right now sweat_smile

It probably doesn't make sense to use 2020-12 quite yet, as implementations are few. 2019-09 is fine for now, or even draft-07.

since JSON-api 1.1 is still in rc3, updating JSON-schema to align with OpenAPI 3.1.0 should be a better futuristic option IMHO.

That might not be a bad call. I could happily update any schema to 2020-12 if ya'll would like.

(also, it's OAS 3.1.0, not 3.10, just for anyone looking back)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

csexton picture csexton  路  5Comments

ethanresnick picture ethanresnick  路  14Comments

designermonkey picture designermonkey  路  13Comments

beauby picture beauby  路  6Comments

beauby picture beauby  路  12Comments