Generate JSON Schema for config entity types

Created on 7 March 2024, 10 months ago

Problem/Motivation

This is a follow-on to ✨ Generate JSON schema for content entity types Needs review but for content entity types.

Fields on content entities have a well-defined API centered on the typed data API under the hood. We were able to add JSON Schema generation easy enough because the typed data primitives map pretty directly to JSON Schema types, and we reliably know what fields are available on a content entity. That's kinda their entire reason to exist.

Config entities, however, are totally different under the hood. Their equivalent to fields are properties, which get mapped to and from storage using very basic get and set logic. The resulting PHP object simply has the property values set directly, and we even allow them to be set dynamically if the config entity object doesn't have it explicitly declared.

This makes schema generation pretty hard because: where do we get a "definitive" list of properties and their acceptable values? Config may have an associated schema β†’ , but the presence of schema is not strictly enforced. Recent changes in Drupal core allow for schemas to be validated, which unlocks things like PATCHing config entities over an HTTP API.

Proposed resolution

Provide config entity schemas from validatable schema.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

✨ Feature request
Status

Active

Version

11.0 πŸ”₯

Component
ConfigurationΒ  β†’

Last updated 3 days ago

Created by

πŸ‡ΊπŸ‡ΈUnited States bradjones1 Digital Nomad Life

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024