Loading core/assets/schemas/v1/metadata-full.schema.json +1 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ "slotDefinition": { "type": "object", "patternProperties": { "^[a-zA-Z0-9_-]$": { "^[a-zA-Z0-9_-]+$": { "type": "object", "properties": { "title": { Loading core/assets/schemas/v1/metadata.schema.json +1 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ "slotDefinition": { "type": "object", "patternProperties": { "^[a-zA-Z0-9_-]$": { "^[a-zA-Z0-9_-]+$": { "type": "object", "properties": { "title": { Loading core/tests/Drupal/Tests/Core/Theme/Component/ComponentValidatorTest.php +16 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,22 @@ public static function dataProviderValidateDefinitionInvalid(): \Generator { // allowed as the allowed type. $cta_with_non_string_prop_type['props']['properties']['text']['type'] = ['string', []]; yield 'non string type (Array)' => [$cta_with_non_string_prop_type]; $cta_with_invalid_slot_type = $valid_cta; $cta_with_invalid_slot_type['slots'] = [ 'valid_slot' => [ 'title' => 'Valid slot', 'description' => 'Valid slot description', ], 'invalid_slot' => [ 'title' => [ 'hello' => 'Invalid slot', 'world' => 'Invalid slot', ], 'description' => 'Title must be string', ], ]; yield 'invalid slot (type)' => [$cta_with_invalid_slot_type]; } /** Loading Loading
core/assets/schemas/v1/metadata-full.schema.json +1 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ "slotDefinition": { "type": "object", "patternProperties": { "^[a-zA-Z0-9_-]$": { "^[a-zA-Z0-9_-]+$": { "type": "object", "properties": { "title": { Loading
core/assets/schemas/v1/metadata.schema.json +1 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,7 @@ "slotDefinition": { "type": "object", "patternProperties": { "^[a-zA-Z0-9_-]$": { "^[a-zA-Z0-9_-]+$": { "type": "object", "properties": { "title": { Loading
core/tests/Drupal/Tests/Core/Theme/Component/ComponentValidatorTest.php +16 −0 Original line number Diff line number Diff line Loading @@ -102,6 +102,22 @@ public static function dataProviderValidateDefinitionInvalid(): \Generator { // allowed as the allowed type. $cta_with_non_string_prop_type['props']['properties']['text']['type'] = ['string', []]; yield 'non string type (Array)' => [$cta_with_non_string_prop_type]; $cta_with_invalid_slot_type = $valid_cta; $cta_with_invalid_slot_type['slots'] = [ 'valid_slot' => [ 'title' => 'Valid slot', 'description' => 'Valid slot description', ], 'invalid_slot' => [ 'title' => [ 'hello' => 'Invalid slot', 'world' => 'Invalid slot', ], 'description' => 'Title must be string', ], ]; yield 'invalid slot (type)' => [$cta_with_invalid_slot_type]; } /** Loading