Skip to content

Commit f79aae8

Browse files
authored
feat: detect empty name in integer type (#270)
Part of #253. Fixes two discrepancies in the test that checks consistency between the action's logic and the schema.
1 parent f26c8da commit f79aae8

File tree

1 file changed

+3
-0
lines changed
  • src/jvmMain/kotlin/it/krzeminski/githubactionstyping/validation/types

1 file changed

+3
-0
lines changed

src/jvmMain/kotlin/it/krzeminski/githubactionstyping/validation/types/Integer.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ fun ApiItem.validateInteger(): ItemValidationResult {
1313
if (this.namedValues?.keys?.any { it.isBlank() } == true) {
1414
return ItemValidationResult.Invalid("Named value names must not be empty.")
1515
}
16+
if (this.name != null && this.name.isBlank()) {
17+
return ItemValidationResult.Invalid("Name must not be empty.")
18+
}
1619
if (this.allowedValues != null) {
1720
return ItemValidationResult.Invalid("'allowed-values' is not allowed for this type.")
1821
}

0 commit comments

Comments
 (0)