File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
src/jvmMain/kotlin/it/krzeminski/githubactionstyping/validation/types Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,9 @@ import it.krzeminski.githubactionstyping.parsing.ApiItem
44import it.krzeminski.githubactionstyping.validation.ItemValidationResult
55
66fun ApiItem.validateEnum (): ItemValidationResult {
7+ if (this .name?.isBlank() == true ) {
8+ return ItemValidationResult .Invalid (" Name must not be empty." )
9+ }
710 if (this .allowedValues == null ) {
811 return ItemValidationResult .Invalid (" Allowed values must be specified." )
912 }
@@ -19,5 +22,8 @@ fun ApiItem.validateEnum(): ItemValidationResult {
1922 if (this .allowedValues.isEmpty()) {
2023 return ItemValidationResult .Invalid (" There must be at least one allowed value." )
2124 }
25+ if (this .allowedValues.any { it.isBlank() }) {
26+ return ItemValidationResult .Invalid (" Allowed values must not be empty." )
27+ }
2228 return ItemValidationResult .Valid
2329}
Original file line number Diff line number Diff line change @@ -11,6 +11,9 @@ fun ApiItem.validateList(): ItemValidationResult {
1111 if (this .listItem == null ) {
1212 return ItemValidationResult .Invalid (" List item information must be specified." )
1313 }
14+ if (this .listItem.name?.isBlank() == true ) {
15+ return ItemValidationResult .Invalid (" List item type: Name must not be empty." )
16+ }
1417 if (this .separator == null ) {
1518 return ItemValidationResult .Invalid (" Separator must be specified." )
1619 }
You can’t perform that action at this time.
0 commit comments