[FIX] missing string size checker

This commit is contained in:
Edouard DUPIN 2025-01-29 22:41:08 +01:00
parent 510553550f
commit 69880df4aa
2 changed files with 4 additions and 0 deletions

View File

@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.Column; import jakarta.persistence.Column;
import jakarta.persistence.Table; import jakarta.persistence.Table;
import jakarta.validation.constraints.Size;
@Table(name = "data") @Table(name = "data")
@DataIfNotExists @DataIfNotExists
@ -14,9 +15,11 @@ import jakarta.persistence.Table;
public class Data extends OIDGenericDataSoftDelete { public class Data extends OIDGenericDataSoftDelete {
@Column(length = 128, nullable = false) @Column(length = 128, nullable = false)
@Schema(description = "Sha512 of the data") @Schema(description = "Sha512 of the data")
@Size(max = 512)
public String sha512; public String sha512;
@Column(length = 128, nullable = false) @Column(length = 128, nullable = false)
@Schema(description = "Mime -type of the media") @Schema(description = "Mime -type of the media")
@Size(max = 512)
public String mimeType; public String mimeType;
@Column(nullable = false) @Column(nullable = false)
@Schema(description = "Size in Byte of the data") @Schema(description = "Size in Byte of the data")

View File

@ -51,6 +51,7 @@ public class User extends GenericDataSoftDelete {
@Nullable @Nullable
public Boolean blocked = false; public Boolean blocked = false;
@Column(length = 512) @Column(length = 512)
@Size(max = 512)
public String blockedReason; public String blockedReason;
@Schema(description = "List of Id of the specific covers") @Schema(description = "List of Id of the specific covers")