Verified Commit 9f025d2e 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

(cherry picked from commit 9256fc10)
parent edc287f5
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
    "slotDefinition": {
      "type": "object",
      "patternProperties": {
        "^[a-zA-Z0-9_-]$": {
        "^[a-zA-Z0-9_-]+$": {
          "type": "object",
          "properties": {
            "title": {
+1 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@
    "slotDefinition": {
      "type": "object",
      "patternProperties": {
        "^[a-zA-Z0-9_-]$": {
        "^[a-zA-Z0-9_-]+$": {
          "type": "object",
          "properties": {
            "title": {
+16 −0
Original line number Diff line number Diff line
@@ -78,10 +78,26 @@ public static function dataProviderValidateDefinitionInvalid(): array {
      $valid_cta,
      ['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 [
      [$cta_with_missing_required],
      [$cta_with_invalid_class],
      [$cta_with_invalid_enum],
      [$cta_with_invalid_slot_type],
    ];
  }