@@ -40,6 +40,11 @@ class ManifestValidationTest : FunSpec({
40
40
val manifest = TypesManifest (
41
41
inputs = mapOf(
42
42
"enum-input" to ApiItem (type = "enum", allowedValues = listOf("foo", "bar", "baz")),
43
+ "enum-input-with-custom-item-name" to ApiItem (
44
+ type = "enum",
45
+ name = "SomeItemName ",
46
+ allowedValues = listOf("foo", "bar", "baz"),
47
+ ),
43
48
),
44
49
)
45
50
@@ -51,6 +56,7 @@ class ManifestValidationTest : FunSpec({
51
56
overallResult = ItemValidationResult .Valid ,
52
57
inputs = mapOf(
53
58
"enum-input" to ItemValidationResult .Valid ,
59
+ "enum-input-with-custom-item-name" to ItemValidationResult .Valid ,
54
60
),
55
61
)
56
62
}
@@ -468,5 +474,33 @@ class ManifestValidationTest : FunSpec({
468
474
),
469
475
)
470
476
}
477
+
478
+ test("non-enum types with 'name' attribute") {
479
+ // given
480
+ val manifest = TypesManifest (
481
+ inputs = mapOf(
482
+ "string-input" to ApiItem (type = "string", name = "SomeName "),
483
+ "boolean-input" to ApiItem (type = "boolean", name = "SomeName "),
484
+ "integer-input" to ApiItem (type = "integer", name = "SomeName "),
485
+ "float-input" to ApiItem (type = "float", name = "SomeName "),
486
+ "list-input" to ApiItem (type = "list", name = "SomeName ", separator = ",", listItem = ApiItem (type = "string")),
487
+ ),
488
+ )
489
+
490
+ // when
491
+ val result = manifest.validate()
492
+
493
+ // then
494
+ result shouldBe ActionValidationResult (
495
+ overallResult = ItemValidationResult .Invalid ("Some typing is invalid."),
496
+ inputs = mapOf(
497
+ "string-input" to ItemValidationResult .Invalid ("'name' is not allowed for this type."),
498
+ "boolean-input" to ItemValidationResult .Invalid ("'name' is not allowed for this type."),
499
+ "integer-input" to ItemValidationResult .Invalid ("'name' is not allowed for this type."),
500
+ "float-input" to ItemValidationResult .Invalid ("'name' is not allowed for this type."),
501
+ "list-input" to ItemValidationResult .Invalid ("'name' is not allowed for this type."),
502
+ ),
503
+ )
504
+ }
471
505
}
472
506
})
0 commit comments