- 🇺🇸United States m.stenta
We have automated tests now ( 📌 Add basic test coverage Active ) so it would be good to include a test to demonstrate this issue and prevent regressions.
Discovered while working on https://www.drupal.org/project/field_ui_modern → .
For example:
{
"$schema": "https://json-schema.org/draft/2019-09/hyper-schema",
"$id": "http://core.test/jsonapi/field_storage_config/field_storage_config/resource/schema",
"title": "Field storage",
"allOf": [
{
"type": "object",
"properties": {
"type": {
"$ref": "#/definitions/type"
},
"attributes": {
"$ref": "#/definitions/attributes"
}
}
},
{
"$ref": "https://jsonapi.org/schema#/definitions/resource"
}
],
"definitions": {
"type": {
"const": "field_storage_config--field_storage_config"
},
"attributes": {
"properties": {
"drupal_internal__id": {
"type": "string",
"title": "drupal_internal__id"
},
"langcode": {
"type": "string",
"title": "langcode"
},
"status": {
"type": "boolean",
"title": "status"
},
"dependencies": {
"title": "dependencies"
},
"third_party_settings": {
"type": "array",
"items": {
"properties": {
"third_party_settings": {
"title": "third_party_settings"
}
}
}
},
"field_name": {
"type": "string",
"title": "field_name"
},
"entity_type": {
"type": "string",
"title": "entity_type"
},
"field_storage_config_type": {
"type": "string",
"title": "field_storage_config_type"
},
"settings": {
"title": "settings"
},
"module": {
"type": "string",
"title": "module"
},
"locked": {
"type": "boolean",
"title": "locked"
},
"cardinality": {
"type": "integer",
"title": "cardinality"
},
"translatable": {
"type": "boolean",
"title": "translatable"
},
"indexes": {
"type": "array",
"items": {
"properties": {
"indexes": {
"title": "indexes"
}
}
}
},
"persist_with_no_fields": {
"type": "boolean",
"title": "persist_with_no_fields"
},
"custom_storage": {
"type": "boolean",
"title": "custom_storage"
}
},
"description": "Entity attributes",
"type": "object",
"additionalProperties": false
}
}
}
→ note how
"dependencies": {
"title": "dependencies"
},
does not specify any type — it should be a type: object
, with the potential keys being module
, theme
, config
and content
.
Same for other "fields" (top-level properties) like settings
— although that one is field-type-specific, which I'm not sure how we can express in JSON Schema.
Needs work
1.0
Code
It denotes an issue that prevents porting of a contributed project to the stable version of Drupal due to missing APIs, regressions, and so on.
The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
We have automated tests now ( 📌 Add basic test coverage Active ) so it would be good to include a test to demonstrate this issue and prevent regressions.