/jsonapi/block/block/resource/schema.json
Produces the following output:
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "http://vanilla-drupal.local/en/jsonapi/block/block/resource/schema.json?XDEBUG_SESSION_START=PHPSTORM",
"allOf": [
{
"type": "object",
"properties": {
"attributes": {
"$ref": "#/definitions/attributes"
},
"relationships": {
"$ref": "#/definitions/relationships"
}
}
},
{
"$ref": "https://jsonapi.org/schema#/definitions/resource"
}
],
"properties": {
"attributes": {
"$ref": "#/definitions/attributes"
}
},
"definitions": {
"langcode": {
"type": "string"
},
"status": {
"type": "boolean"
},
"dependencies": [],
"attributes": {
"description": "Entity attributes",
"type": "object",
"properties": {
"third_party_settings": {
"properties": {
"third_party_settings": []
}
},
"visibility": {
"properties": {
"visibility": []
}
}
},
"additionalProperties": false
},
"drupal_internal__id": {
"type": "string"
},
"theme": {
"type": "string"
},
"region": {
"type": "string"
},
"weight": {
"type": "integer"
},
"provider": {
"type": "string"
},
"plugin": {
"type": "string"
},
"settings": []
}
}
Note that:
definitions/attributes/properties/third_party_settings is missing "type": "object"
- Some of the properties like: langcode, theme, region, … are incorrectly under
definitions/<code> and they should be under <code>definitions/attributes/properties/
Comments
Comment #2
symbioquine commentedI'm seeing a potentially related issue with the
third_party_settingsschema where the type is present, but is"array"where is should be"object"...Given
/api/asset_type/asset_type&/api/asset_type/asset_type/resource/schemarespectively.Comment #3
wim leersFor me,
/jsonapi/block/block/resource/schemaproduces:— just like for @Symbioquine it seems.
Comment #4
m.stenta@symbioquine and @wimleers are correct:
typeis no longer missing, but it is not correct. It should beobjectinstead ofarray.I am noticing a similar issue in
definitions/relationships/properties/roles/properties/datain the/jsonapi/user/user/resource/schemaendpoint (which is not a config entity resource type, but relates to one):Notice how it declares
"type": "array"instead ofobject, and includes anitemsarray. Just like in thethird_party_settingsexample.This does feel related to #3324824: Schema incorrect for config entity "fields" that are Maps and Sequences as @wimleers pointed out (https://www.drupal.org/project/jsonapi_schema/issues/3324824#comment-148...). I wonder if we should close this as "outdated" and work on fixing config entity normalization generally over there.
This appears to be resolved in 8.x-1.x. Not sure when it was fixed, but they are all under
definitions/attributes/properties/now.Comment #5
m.stentaNevermind, this is supposed to be an
arraybecause it's describing a list of all the roles the user has.Comment #6
m.stentaWe have automated tests now (#3257911: Add basic test coverage) so it would be good to include a test to demonstrate this issue and prevent regressions.