Skip to content

Commit 10e7415

Browse files
committed
chore(font): rework parameter validation
1 parent 43271be commit 10e7415

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/main/java/net/onelitefeather/vulpes/backend/domain/font/FontModelDTO.java

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
import io.micronaut.serde.annotation.Serdeable;
44
import io.swagger.v3.oas.annotations.media.Schema;
5+
import jakarta.annotation.Nullable;
6+
import jakarta.validation.constraints.NotBlank;
57
import jakarta.validation.constraints.NotNull;
8+
import jakarta.validation.constraints.PositiveOrZero;
69
import net.onelitefeather.vulpes.api.model.FontEntity;
710

811
import java.util.List;
@@ -12,14 +15,14 @@
1215
@Serdeable
1316
public record FontModelDTO(
1417
@Schema(description = "ID of the mode", requiredMode = Schema.RequiredMode.NOT_REQUIRED) UUID id,
15-
@Schema(description = "Model Name for the ui", requiredMode = Schema.RequiredMode.REQUIRED) String uiName,
16-
@Schema(description = "Name in the UI", requiredMode = Schema.RequiredMode.REQUIRED) String variableName,
17-
@Schema(description = "Which provider should be used", requiredMode = Schema.RequiredMode.REQUIRED) String provider,
18-
@Schema(description = "Internal mapper variable", requiredMode = Schema.RequiredMode.REQUIRED) String mapper,
19-
@Schema(description = "The path to the texture", requiredMode = Schema.RequiredMode.REQUIRED) String texturePath,
20-
@Schema(description = "The comment", requiredMode = Schema.RequiredMode.REQUIRED) String comment,
21-
@Schema(description = "The ascent property", requiredMode = Schema.RequiredMode.REQUIRED) int ascent,
22-
@Schema(description = "The height property", requiredMode = Schema.RequiredMode.REQUIRED) int height,
18+
@Schema(description = "Model Name for the ui", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank @NotNull String uiName,
19+
@Schema(description = "Name in the UI", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank @NotNull String variableName,
20+
@Schema(description = "Which provider should be used", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank @NotNull String provider,
21+
@Schema(description = "Internal mapper variable", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank @NotNull String mapper,
22+
@Schema(description = "The path to the texture", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank @NotNull String texturePath,
23+
@Schema(description = "The comment", requiredMode = Schema.RequiredMode.REQUIRED) @Nullable String comment,
24+
@Schema(description = "The ascent property", requiredMode = Schema.RequiredMode.REQUIRED) @PositiveOrZero int ascent,
25+
@Schema(description = "The height property", requiredMode = Schema.RequiredMode.REQUIRED) @PositiveOrZero int height,
2326
@Schema(description = "The chars which are overwritten", requiredMode = Schema.RequiredMode.NOT_REQUIRED) List<String> chars
2427
) {
2528

0 commit comments

Comments
 (0)