Change record status: 
Project: 
Introduced in branch: 
10.3.x
Introduced in version: 
10.3.0
Description: 

We have introduced a new Validation Constraint with: EntityBundleExists.
This constraint takes the name of an entity bundle and confirms that it actually exists. It accepts only one (required) argument -- the entity type ID.

An example that could be used in config schema, if you want to confirm that the bundle value is the machine name of a node type:

bundle:
  type: string
  constraints:
    EntityBundleExists: node

The entity type ID can be resolved dynamically for nested structures. This example comes from the field_config_base structure, which forms the basis of field_config entities and base field overrides:

entity_type:
  type: string
bundle:
  type: string
  constraints:
    EntityBundleExists: '%parent.entity_type'
Impacts: 
Module developers