Skip to content
Snippets Groups Projects
Verified Commit 9256fc10 authored by Théodore Biadala's avatar Théodore Biadala
Browse files

Issue #3517317 by penyaskito, larowlan: SDC slots not being validated against json config schema

parent c2b52d71
No related branches found
No related tags found
No related merge requests found
Pipeline #465290 passed
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"slotDefinition": { "slotDefinition": {
"type": "object", "type": "object",
"patternProperties": { "patternProperties": {
"^[a-zA-Z0-9_-]$": { "^[a-zA-Z0-9_-]+$": {
"type": "object", "type": "object",
"properties": { "properties": {
"title": { "title": {
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"slotDefinition": { "slotDefinition": {
"type": "object", "type": "object",
"patternProperties": { "patternProperties": {
"^[a-zA-Z0-9_-]$": { "^[a-zA-Z0-9_-]+$": {
"type": "object", "type": "object",
"properties": { "properties": {
"title": { "title": {
......
...@@ -78,10 +78,26 @@ public static function dataProviderValidateDefinitionInvalid(): array { ...@@ -78,10 +78,26 @@ public static function dataProviderValidateDefinitionInvalid(): array {
$valid_cta, $valid_cta,
['extension_type' => 'invalid'], ['extension_type' => 'invalid'],
); );
$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',
],
];
return [ return [
[$cta_with_missing_required], [$cta_with_missing_required],
[$cta_with_invalid_class], [$cta_with_invalid_class],
[$cta_with_invalid_enum], [$cta_with_invalid_enum],
[$cta_with_invalid_slot_type],
]; ];
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment