Issue #3517317 by penyaskito, larowlan: SDC slots not being validated against json config schema
(cherry picked from commit 96c70753fe
)
merge-requests/11792/head
parent
6ef89d9910
commit
a9c54fca06
|
@ -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 @@
|
||||||
"slotDefinition": {
|
"slotDefinition": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"patternProperties": {
|
"patternProperties": {
|
||||||
"^[a-zA-Z0-9_-]$": {
|
"^[a-zA-Z0-9_-]+$": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"title": {
|
"title": {
|
||||||
|
|
|
@ -102,6 +102,22 @@ class ComponentValidatorTest extends TestCase {
|
||||||
// allowed as the allowed type.
|
// allowed as the allowed type.
|
||||||
$cta_with_non_string_prop_type['props']['properties']['text']['type'] = ['string', []];
|
$cta_with_non_string_prop_type['props']['properties']['text']['type'] = ['string', []];
|
||||||
yield 'non string type (Array)' => [$cta_with_non_string_prop_type];
|
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…
Reference in New Issue