Postponed
Project:
Drupal core
Version:
main
Component:
jsonapi.module
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
28 Oct 2016 at 04:43 UTC
Updated:
12 Jan 2022 at 01:28 UTC
Jump to comment: Most recent
Comments
Comment #2
wim leersIsn't this a duplicate of #2917260: Validate against specific JSON Schemas if Schemata is present?
Assigning to @e0ipso to find out.
Comment #3
gabesulliceThis is not a duplicate. This is about exposing schemas via the API itself. For example, we might have a link like
/jsonapi/node/article/schema, which would return the schema for node articles.This is important for generic JSON API clients to interact with our API without any foreknowledge of our specific implementation.
Comment #4
wim leersOh, interesting! That'd be powerful for https://www.drupal.org/project/openapi!
Comment #5
e0ipsoThis should be "simple" since we're already generating the schemas when validating against them if schemata is present.
For clarity, there is already a way to download / access the schema via a URL using the Schemata module. We could issue a 3xx or respond directly.
Comment #6
wim leersThis would only work when the Schemata module is installed, right?
Comment #7
e0ipsoYes.
Comment #8
wim leersThen perhaps 3xx redirects with URLs generated using
internal:rather than using Schemata's routes would work. That way, we don't depend on Schemata at all, and the 3xx response will point to a 404 response, but upon installing the Schemata module, those 404s would become 200s.Comment #9
e0ipsoYeah, that would further simplify the implentation.
+1
Comment #10
wim leersComment #11
wim leersFYI: this is being discussed in the JSON API spec project: https://github.com/json-api/json-api/issues/1281
Comment #12
e0ipsoThat's really interesting @Wim Leers, thanks for linking that issue. Schema autodiscovery & integration would be a killer feature indeed.
Comment #13
wim leersNo problem, I should've linked it a month ago or so, when I first saw it! Sorry for not doing it sooner.
Comment #14
wim leersThis is blocked on #2994473: [META] JSON API's normalizers support schema tracking, to guarantee comprehensive schema.
Comment #15
bradjones1Moving to core.