- Issue created by @bradjones1
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.
Provide config entity schemas from validatable schema.
Active
11.0 π₯
Last updated