diff --git a/application/openapi.yaml b/application/openapi.yaml index ad0409608d74bee41087e980e18ff58fe5d8b776..b53ae168b2a36251d71568da139505eb53934226 100644 --- a/application/openapi.yaml +++ b/application/openapi.yaml @@ -39,10 +39,12 @@ components: type: string description: Name of the person example: Max + maxLength: 35 surname: type: string description: Surname of the person example: Verstappen + maxLength: 35 birthday: type: string description: Date of birth @@ -64,9 +66,11 @@ components: name: type: string description: Name of the person + maxLength: 35 surname: type: string description: Name of the person + maxLength: 35 birthday: type: string description: Date of birth diff --git a/application/src/main/java/cz/muni/pa165/data/model/Application.java b/application/src/main/java/cz/muni/pa165/data/model/Application.java index c597fbb4ad52e08dc26dc9f9e8b81d55b2533217..578ee814be2e0b1b3992ba684129a0c529561387 100644 --- a/application/src/main/java/cz/muni/pa165/data/model/Application.java +++ b/application/src/main/java/cz/muni/pa165/data/model/Application.java @@ -22,9 +22,11 @@ public class Application implements Serializable { private ApplicationStatusEnum status; @NotEmpty + @Size(max = 35) private String name; @NotEmpty + @Size(max = 35) private String surname; @Past diff --git a/core/openapi.yaml b/core/openapi.yaml index 03bf9819526868392e5e44723e99504c801a1b14..0d2b2786ce14a421db580106320e362d256d488b 100644 --- a/core/openapi.yaml +++ b/core/openapi.yaml @@ -47,6 +47,7 @@ components: type: string description: Specific information about component example: lightweight front wing v2 (black) + maxLength: 100 CarComponentCreateDto: type: object properties: @@ -58,6 +59,7 @@ components: information: type: string description: Specific information about component + maxLength: 100 required: - componentType - weight @@ -73,6 +75,7 @@ components: information: type: string description: Specific information about component + maxLength: 100 CarDto: type: object @@ -130,10 +133,12 @@ components: type: string description: Name of the driver example: Max + maxLength: 35 surname: type: string description: Surname of the driver example: Verstappen + maxLength: 35 height: type: integer description: Height in cm @@ -147,6 +152,7 @@ components: type: string description: Nationality of the driver example: Dutch + maxLength: 20 characteristics: type: array description: Set of driver's characteristics @@ -158,12 +164,15 @@ components: name: type: string description: Name of the driver + maxLength: 35 surname: type: string description: Name of the driver + maxLength: 35 nationality: type: string description: nationality of the driver + maxLength: 20 height: type: integer description: Height in cm @@ -178,12 +187,15 @@ components: name: type: string description: Name of the driver + maxLength: 35 surname: type: string description: Name of the driver + maxLength: 35 nationality: type: string description: Nationality of the driver + maxLength: 20 height: type: integer description: Height in cm @@ -220,10 +232,12 @@ components: type: string description: Name of the engineer example: John + maxLength: 35 surname: type: string description: Surname of the engineer example: Doe + maxLength: 35 EngineerCreateDto: type: object title: Engineer @@ -236,10 +250,12 @@ components: type: string description: Name of the engineer example: John + maxLength: 35 surname: type: string description: Surname of the engineer example: Doe + maxLength: 35 DepartmentDto: type: object @@ -259,6 +275,7 @@ components: specialization: type: string example: "Aerodynamics" + maxLength: 100 DepartmentUpdateDto: type: object properties: @@ -266,6 +283,7 @@ components: type: string example: "Aerodynamics" description: New specialization + maxLength: 100 required: - specialization DepartmentCreateDto: @@ -274,6 +292,7 @@ components: specialization: type: string example: "Aerodynamics" + maxLength: 100 required: - specialization Pageable: diff --git a/core/src/main/java/cz/muni/pa165/data/model/CarComponent.java b/core/src/main/java/cz/muni/pa165/data/model/CarComponent.java index 866127df8807a86635ed95a0a510d6197bf04a94..9b63182b9dbb0beb9284918ea42fc30ebc500388 100644 --- a/core/src/main/java/cz/muni/pa165/data/model/CarComponent.java +++ b/core/src/main/java/cz/muni/pa165/data/model/CarComponent.java @@ -6,6 +6,7 @@ import jakarta.annotation.Nullable; import jakarta.persistence.*; import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.Positive; +import jakarta.validation.constraints.Size; import java.io.Serializable; import java.util.Objects; @@ -24,6 +25,7 @@ public class CarComponent extends DomainObject<Long> implements Serializable { private Double weight; @NotEmpty + @Size(max = 100) private String information; @ManyToOne(fetch = FetchType.LAZY) diff --git a/core/src/main/java/cz/muni/pa165/data/model/Department.java b/core/src/main/java/cz/muni/pa165/data/model/Department.java index 8d4ce31ad8a5df7aa1a3df657d8baed3a5254032..43a7be25ad8c4c6543667c61cb9dcca9c080c3ef 100644 --- a/core/src/main/java/cz/muni/pa165/data/model/Department.java +++ b/core/src/main/java/cz/muni/pa165/data/model/Department.java @@ -3,6 +3,7 @@ package cz.muni.pa165.data.model; import jakarta.annotation.Nullable; import jakarta.persistence.*; import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.Size; import java.io.Serializable; import java.util.Objects; @@ -13,6 +14,7 @@ import java.util.Set; public class Department extends DomainObject<Long> implements Serializable { @NotEmpty + @Size(max = 100) private String specialization; @OneToMany(fetch = FetchType.LAZY, diff --git a/core/src/main/java/cz/muni/pa165/data/model/Driver.java b/core/src/main/java/cz/muni/pa165/data/model/Driver.java index 6d401bf117203f4389c7969f46cf046dab681c80..6f8f8e2a9b7bf94b944388e91e9120a36b8a8153 100644 --- a/core/src/main/java/cz/muni/pa165/data/model/Driver.java +++ b/core/src/main/java/cz/muni/pa165/data/model/Driver.java @@ -4,10 +4,7 @@ import cz.muni.pa165.data.enums.CharacteristicsEnum; import jakarta.annotation.Nonnull; import jakarta.annotation.Nullable; import jakarta.persistence.*; -import jakarta.validation.constraints.Max; -import jakarta.validation.constraints.Min; -import jakarta.validation.constraints.NotEmpty; -import jakarta.validation.constraints.Past; +import jakarta.validation.constraints.*; import java.io.Serializable; import java.time.LocalDate; @@ -19,9 +16,11 @@ import java.util.Set; public class Driver extends DomainObject<Long> implements Serializable { @NotEmpty + @Size(max = 35) private String name; @NotEmpty + @Size(max = 35) private String surname; @Nullable @@ -34,6 +33,7 @@ public class Driver extends DomainObject<Long> implements Serializable { private LocalDate birthday; @NotEmpty + @Size(max = 20) private String nationality; @ElementCollection(targetClass = CharacteristicsEnum.class) diff --git a/core/src/main/java/cz/muni/pa165/data/model/Engineer.java b/core/src/main/java/cz/muni/pa165/data/model/Engineer.java index ca2551ed8d6d298249a4617ddc15f15cb190eb83..1e8e5dbad8c6b3f68ace657aaa60ce16d50dc3cc 100644 --- a/core/src/main/java/cz/muni/pa165/data/model/Engineer.java +++ b/core/src/main/java/cz/muni/pa165/data/model/Engineer.java @@ -3,6 +3,7 @@ package cz.muni.pa165.data.model; import jakarta.annotation.Nullable; import jakarta.persistence.*; import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.Size; import java.io.Serializable; import java.util.Objects; @@ -12,9 +13,11 @@ import java.util.Objects; public class Engineer extends DomainObject<Long> implements Serializable { @NotEmpty + @Size(max = 35) private String name; @NotEmpty + @Size(max = 35) private String surname; @ManyToOne(fetch = FetchType.LAZY)