config_test.schema.yml
Same filename and directory in other branches
- 11.x core/modules/config/tests/config_test/config/schema/config_test.schema.yml
- 10 core/modules/config/tests/config_test/config/schema/config_test.schema.yml
- 9 core/modules/config/tests/config_test/config/schema/config_test.schema.yml
- 8.9.x core/modules/config/tests/config_test/config/schema/config_test.schema.yml
File
-
core/
modules/ config/ tests/ config_test/ config/ schema/ config_test.schema.yml
View source
- # Schema for the configuration files of the Configuration Test module.
-
- config_test_dynamic:
- type: config_entity
- mapping:
- id:
- type: string
- label: 'ID'
- label:
- type: label
- label: 'Label'
- weight:
- type: weight
- label: 'Weight'
- style:
- type: string
- label: 'style'
- size:
- type: string
- label: 'Size'
- size_value:
- type: string
- label: 'Size value'
- protected_property:
- type: string
- label: 'Protected property'
- array_property:
- type: ignore
- label: 'Array property'
-
- config_test.dynamic.*:
- type: config_test_dynamic
- label: 'Config test dynamic settings'
-
- config_test.dynamic.*.*:
- type: config_test_dynamic
- label: 'Config test dynamic settings'
-
- config_test.dynamic.*.third_party.node:
- type: mapping
- mapping:
- foo:
- type: string
-
- config_test.query.*:
- type: config_entity
- mapping:
- id:
- type: string
- label: 'ID'
- label:
- type: label
- label: 'Label'
- array:
- type: sequence
- label: 'Array level 1'
- sequence:
- type: sequence
- label: 'Array level 2'
- sequence:
- type: integer
- label: 'Value'
- number:
- type: integer
- label: 'number'
-
- config_test.types:
- type: config_object
- label: 'Configuration type'
- mapping:
- array:
- type: sequence
- label: 'Array'
- sequence:
- type: string
- label: 'Item'
- boolean:
- type: boolean
- label: 'Boolean'
- exp:
- type: float
- label: 'Exponential'
- float:
- type: float
- label: 'Float'
- float_as_integer:
- type: float
- label: 'Float'
- hex:
- type: integer
- label: 'Hexadecimal'
- int:
- type: integer
- label: 'Integer'
- octal:
- # Symfony 5.1's YAML parser issues a deprecation when reading octal with a
- # leading zero, to comply with YAML 1.2. However PECL YAML is still YAML 1.1
- # compliant.
- # @see core/modules/config/tests/config_test/config/install/config_test.types.yml
- # @see \Drupal\KernelTests\Core\Config\ConfigCRUDTest::testDataTypes()
- # @todo Mark as required again in https://www.drupal.org/project/drupal/issues/3205480
- requiredKey: false
- type: integer
- label: 'Octal'
- string:
- type: string
- label: 'String'
- string_int:
- type: string
- label: 'String integer'
- # All the above types, but now nullable.
- nullable_array:
- type: sequence
- label: 'Nullable array'
- nullable: true
- sequence:
- type: string
- label: 'Item'
- nullable_boolean:
- type: boolean
- label: 'Nullable boolean'
- nullable: true
- nullable_exp:
- type: float
- label: 'Nullable exponential'
- nullable: true
- nullable_float:
- type: float
- label: 'Nullable float'
- nullable: true
- nullable_float_as_integer:
- type: float
- label: 'Float'
- nullable: true
- nullable_hex:
- type: integer
- label: 'Nullable hexadecimal'
- nullable: true
- nullable_int:
- type: integer
- label: 'Nullable integer'
- nullable: true
- nullable_octal:
- type: integer
- label: 'Nullable octal'
- nullable: true
- nullable_string:
- type: string
- label: 'Nullable string'
- nullable: true
- nullable_string_int:
- type: string
- label: 'Nullable string integer'
- nullable: true
- # To test required vs optional keys.
- mapping_with_only_required_keys:
- type: mapping
- label: 'Mapping with only required keys'
- mapping:
- north: { type: string }
- east: { type: string }
- south: { type: string }
- west: { type: string }
- mapping_with_some_required_keys:
- type: mapping
- label: 'Mapping with only required keys'
- mapping:
- north: { type: string }
- east: { type: string, requiredKey: false }
- south: { type: string }
- west: { type: string, requiredKey: false }
- mapping_with_only_optional_keys:
- type: mapping
- label: 'Mapping with only optional keys'
- mapping:
- north: { type: string, requiredKey: false }
- east: { type: string, requiredKey: false }
- south: { type: string, requiredKey: false }
- west: { type: string, requiredKey: false }
-
- config_test.types.fully_validatable:
- type: config_test.types
- constraints:
- FullyValidatable: ~
-
- config_test.no_status.default:
- type: config_object
- label: 'Configuration no status default'
- mapping:
- id:
- type: string
- label: 'ID'
- label:
- type: label
- label: 'Label'
- uuid:
- type: string
- label: 'UUID'
-
- config_test.system:
- type: config_object
- label: 'Configuration system'
- mapping:
- foo:
- type: string
- label: 'Foo'
- baz:
- type: string
- label: 'Baz'
- '404':
- type: string
- label: '404'
-
- config_test.new:
- type: config_object
- label: 'Configuration test'
- mapping:
- key:
- type: string
- label: 'Test setting'
- new_key:
- type: string
- label: 'Test setting'
- uuid:
- type: uuid
-
- config_test.old:
- type: config_test.new
-
- config_test.foo:
- type: config_object
- label: 'Configuration test'
- mapping:
- value:
- type: mapping
- label: 'Value'
- mapping:
- key:
- type: string
- label: 'Key'
- label:
- type: label
- label: 'Label'
- # Note that config_object should never be used on a non-root key.
- broken_langcode_required:
- type: config_object
- required: false
- mapping:
- foo:
- type: string
-
- config_test.bar:
- type: config_test.foo
-
- system.action.*.third_party.config_test:
- type: mapping
- label: 'Third party setting for action entity'
- mapping:
- integer:
- type: integer
- label: 'Integer'
-
- config_test.validation:
- type: config_object
- label: 'Configuration type'
- constraints:
- AtLeastOneOf:
- messageCollection: 'Either block_id and block_revision_id, or block_serialized must be provided.'
- constraints:
- - MappingCollection:
- allowExtraFields: true
- allowMissingFields: false
- fields:
- block_id:
- Required:
- constraints:
- - NotNull: {}
- - NotBlank: {}
- block_revision_id:
- Required:
- constraints:
- - NotNull: {}
- - NotBlank: {}
- block_serialized:
- Optional: {}
- - MappingCollection:
- allowExtraFields: true
- allowMissingFields: false
- fields:
- block_id:
- Optional: {}
- block_revision_id:
- Optional: {}
- block_serialized:
- Required:
- constraints:
- - Serialized: []
- - NotNull: {}
- - NotBlank: {}
- Callback:
- callback: [\Drupal\config_test\ConfigValidation, validateMapping]
- mapping:
- llama:
- type: string
- constraints:
- Callback:
- callback: [\Drupal\config_test\ConfigValidation, validateLlama]
- cat:
- type: mapping
- constraints:
- NotBlank: {}
- NotNull: {}
- AtLeastOneOf:
- constraints:
- - NotBlank: {}
- - NotNull: {}
- mapping:
- type:
- type: string
- constraints:
- Callback:
- callback: [\Drupal\config_test\ConfigValidation, validateCats]
- count:
- type: integer
- constraints:
- Callback:
- callback: [\Drupal\config_test\ConfigValidation, validateCatCount]
- giraffe:
- type: sequence
- constraints:
- Callback:
- callback: [\Drupal\config_test\ConfigValidation, validateSequence]
- sequence:
- type: string
- constraints:
- Callback:
- callback: [\Drupal\config_test\ConfigValidation, validateGiraffes]
- uuid:
- type: uuid
-
- # @see \Drupal\KernelTests\Config\TypedConfigTest::testNotBlankInteractionWithNotNull()
- string__not_blank:
- type: string
- constraints:
- NotBlank: {}
-
- host:
- type: string
- constraints:
- UriHost: ~
-
- block_id:
- type: integer
- label: 'Block ID'
- nullable: true
- constraints:
- Range:
- min: 1
-
- block_revision_id:
- type: integer
- label: 'Block revision ID'
- nullable: true
- constraints:
- Range:
- min: 1
-
- block_serialized:
- type: string
- label: 'Serialized block'
- nullable: true
- constraints:
- Serialized: []
-
- composite:
- type: mapping
- nullable: true
- mapping:
- sequentially:
- required: false
- type: string
- constraints:
- Sequentially:
- constraints:
- - NotBlank: []
- - Length:
- min: 1
- max: 10
- at_least_one_of:
- required: false
- type: string
- constraints:
- AtLeastOneOf:
- constraints:
- - Range:
- min: 0
- max: 10
- - Range:
- min: 20
- max: 30
- nested:
- required: false
- type: string
- constraints:
- Sequentially:
- constraints:
- - NotBlank: []
- - AtLeastOneOf:
- constraints:
- - Length:
- min: 1
- max: 10
- - Length:
- min: 20
- max: 30
-
- string_concat_value_1:
- type: string
- label: 'String part 1'
-
- string_concat_value_2:
- type: string
- label: 'String part 2'
-
- string_concat_values:
- type: string
- label: 'String parts'
- constraints:
- StringEqualsConcatenatedValues:
- separator: .
- reservedCharacters:
- - '|'
- reservedCharactersSubstitute: '>'
- values:
- - '%parent.string_concat_value_1'
- - '%parent.string_concat_value_2'
-
- string_concat_values_invalid:
- type: string
- nullable: true
- constraints:
- StringEqualsConcatenatedValues:
- separator: .
- values:
- - '%parent.invalid'
- - '%parent.reference'
-
- config_test.string_concat_values_invalid:
- type: config_object
- label: 'Configuration type'
- constraints:
- Callback:
- callback: [\Drupal\config_test\ConfigValidation, validateMapping]
- mapping:
- string_concat_values_invalid:
- type: string
- nullable: true
- constraints:
- StringEqualsConcatenatedValues:
- separator: .
- values:
- - '%parent.host'
- - '%parent.green'
-
- config_test.with_plural_label:
- type: config_object
- mapping:
- label:
- type: plural_label
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.