config_test.schema.yml
Same filename in other branches
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:
- Callback:
- callback: [\Drupal\config_test\ConfigValidation, validateMapping]
- mapping:
- llama:
- type: string
- constraints:
- Callback:
- callback: [\Drupal\config_test\ConfigValidation, validateLlama]
- cat:
- type: mapping
- 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: {}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.