From 975203450995acae07ccc4f1373222946914faea Mon Sep 17 00:00:00 2001 From: FergeSS Date: Thu, 5 Dec 2024 16:54:26 +0300 Subject: [PATCH] 62 add fields and contours validation --- src/main/java/agroscience/fields/v2/entities/FieldV2.java | 2 +- src/main/resources/openapi/openapi.yaml | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/agroscience/fields/v2/entities/FieldV2.java b/src/main/java/agroscience/fields/v2/entities/FieldV2.java index 244f0c7..46ac3ed 100644 --- a/src/main/java/agroscience/fields/v2/entities/FieldV2.java +++ b/src/main/java/agroscience/fields/v2/entities/FieldV2.java @@ -24,7 +24,7 @@ @EqualsAndHashCode(callSuper = true) public class FieldV2 extends AbstractEntity { - @Column(name = "name") + @Column(name = "name", length = 20, nullable = false) private String name; @Column(name = "description") diff --git a/src/main/resources/openapi/openapi.yaml b/src/main/resources/openapi/openapi.yaml index badf0a6..1e37210 100644 --- a/src/main/resources/openapi/openapi.yaml +++ b/src/main/resources/openapi/openapi.yaml @@ -607,13 +607,14 @@ components: readOnly: true name: type: string - description: The name of the field + minimum: 1 + maximum: 20 + description: The name of the field should be in the range from 1 to 20 description: type: string description: Description of the field required: - name - - description FieldDTO: allOf: