From 3c30ee48806d814d020e68da18b95438f7f9c549 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Wed, 11 Dec 2024 11:02:25 +0100 Subject: [PATCH] remove redundant minLength/maxLength constraints where length-limited pattern is given --- .../hs-office/hs-office-coopassets-schemas.yaml | 6 ------ .../hs-office/hs-office-debitor-schemas.yaml | 2 -- .../hs-office-debitors-with-debitorNumber.yaml | 4 ++-- .../api-definition/hs-office/hs-office-debitors.yaml | 2 -- .../hs-office/hs-office-membership-schemas.yaml | 10 ++-------- .../hs-office/hs-office-memberships.yaml | 2 -- .../hs-office/hs-office-partner-schemas.yaml | 4 ---- 7 files changed, 4 insertions(+), 26 deletions(-) diff --git a/src/main/resources/api-definition/hs-office/hs-office-coopassets-schemas.yaml b/src/main/resources/api-definition/hs-office/hs-office-coopassets-schemas.yaml index a666229d..e84e733c 100644 --- a/src/main/resources/api-definition/hs-office/hs-office-coopassets-schemas.yaml +++ b/src/main/resources/api-definition/hs-office/hs-office-coopassets-schemas.yaml @@ -27,8 +27,6 @@ components: nullable: false membership.memberNumber: type: string - minLength: 9 - maxLength: 9 pattern: 'M-[0-9]{7}' transactionType: $ref: '#/components/schemas/HsOfficeCoopAssetsTransactionType' @@ -69,8 +67,6 @@ components: nullable: false membership.memberNumber: type: string - minLength: 9 - maxLength: 9 pattern: 'M-[0-9]{7}' transactionType: $ref: '#/components/schemas/HsOfficeCoopAssetsTransactionType' @@ -130,8 +126,6 @@ components: format: uuid adoptingMembership.memberNumber: type: string - minLength: 9 - maxLength: 9 pattern: 'M-[0-9]{7}' required: - membership.uuid diff --git a/src/main/resources/api-definition/hs-office/hs-office-debitor-schemas.yaml b/src/main/resources/api-definition/hs-office/hs-office-debitor-schemas.yaml index bca2f0a2..c868a459 100644 --- a/src/main/resources/api-definition/hs-office/hs-office-debitor-schemas.yaml +++ b/src/main/resources/api-definition/hs-office/hs-office-debitor-schemas.yaml @@ -13,8 +13,6 @@ components: $ref: 'hs-office-relation-schemas.yaml#/components/schemas/HsOfficeRelation' debitorNumber: type: string - minLength: 9 - maxLength: 9 pattern: 'D-[0-9]{7}' debitorNumberSuffix: type: string diff --git a/src/main/resources/api-definition/hs-office/hs-office-debitors-with-debitorNumber.yaml b/src/main/resources/api-definition/hs-office/hs-office-debitors-with-debitorNumber.yaml index 565f2523..9e34b758 100644 --- a/src/main/resources/api-definition/hs-office/hs-office-debitors-with-debitorNumber.yaml +++ b/src/main/resources/api-definition/hs-office/hs-office-debitors-with-debitorNumber.yaml @@ -12,8 +12,8 @@ get: schema: type: number format: integer -# minimum: 1000000 -# maximum: 9999999 + minimum: 1000000 + maximum: 9999999 description: debitor-number of the debitor to fetch. responses: "200": diff --git a/src/main/resources/api-definition/hs-office/hs-office-debitors.yaml b/src/main/resources/api-definition/hs-office/hs-office-debitors.yaml index 05533d03..20ceb02c 100644 --- a/src/main/resources/api-definition/hs-office/hs-office-debitors.yaml +++ b/src/main/resources/api-definition/hs-office/hs-office-debitors.yaml @@ -25,8 +25,6 @@ get: required: false schema: type: string - minLength: 7 - maxLength: 7 pattern: 'P-[0-9]{5}' description: Partner number of the requested debitor. responses: diff --git a/src/main/resources/api-definition/hs-office/hs-office-membership-schemas.yaml b/src/main/resources/api-definition/hs-office/hs-office-membership-schemas.yaml index cc723a41..f7263700 100644 --- a/src/main/resources/api-definition/hs-office/hs-office-membership-schemas.yaml +++ b/src/main/resources/api-definition/hs-office/hs-office-membership-schemas.yaml @@ -27,14 +27,10 @@ components: $ref: 'hs-office-debitor-schemas.yaml#/components/schemas/HsOfficeDebitor' memberNumber: type: string - minLength: 9 - maxLength: 9 pattern: 'M-[0-9]{7}' memberNumberSuffix: type: string - minLength: 2 - maxLength: 2 - pattern: '[0-9]+' + pattern: '[0-9]{2}' validFrom: type: string format: date @@ -69,9 +65,7 @@ components: nullable: false memberNumberSuffix: type: string - minLength: 2 - maxLength: 2 - pattern: '[0-9]+' + pattern: '[0-9]{2}' nullable: false validFrom: type: string diff --git a/src/main/resources/api-definition/hs-office/hs-office-memberships.yaml b/src/main/resources/api-definition/hs-office/hs-office-memberships.yaml index f0da7c61..1be0fd23 100644 --- a/src/main/resources/api-definition/hs-office/hs-office-memberships.yaml +++ b/src/main/resources/api-definition/hs-office/hs-office-memberships.yaml @@ -20,8 +20,6 @@ get: required: false schema: type: string - minLength: 7 - maxLength: 7 pattern: 'P-[0-9]{5}' description: partnerNumber of the partner the memberships belong to responses: diff --git a/src/main/resources/api-definition/hs-office/hs-office-partner-schemas.yaml b/src/main/resources/api-definition/hs-office/hs-office-partner-schemas.yaml index 2fd3d39b..727c5b61 100644 --- a/src/main/resources/api-definition/hs-office/hs-office-partner-schemas.yaml +++ b/src/main/resources/api-definition/hs-office/hs-office-partner-schemas.yaml @@ -11,8 +11,6 @@ components: format: uuid partnerNumber: type: string - minLength: 7 - maxLength: 7 pattern: 'P-[0-9]{5}' partnerRel: $ref: 'hs-office-relation-schemas.yaml#/components/schemas/HsOfficeRelation' @@ -87,8 +85,6 @@ components: properties: partnerNumber: type: string - minLength: 7 - maxLength: 7 pattern: 'P-[0-9]{5}' partnerRel: $ref: '#/components/schemas/HsOfficePartnerRelInsert'