From 6c714b47ba9616c0882ff3eaa94d08ef6d911f7a Mon Sep 17 00:00:00 2001 From: Alexis Drai Date: Tue, 13 Jun 2023 11:52:41 +0200 Subject: [PATCH] :ambulance: Allow Pokemong with no moves (#6) Co-authored-by: alexis.drai@etu.uca.fr Reviewed-on: https://codefirst.iut.uca.fr/git/alexis.drai/pokemong_api/pulls/6 --- src/main/java/fr/uca/iut/services/PokemongService.java | 4 ++-- src/main/resources/META-INF/openapi.yaml | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/fr/uca/iut/services/PokemongService.java b/src/main/java/fr/uca/iut/services/PokemongService.java index a3c0743..085d300 100644 --- a/src/main/java/fr/uca/iut/services/PokemongService.java +++ b/src/main/java/fr/uca/iut/services/PokemongService.java @@ -93,8 +93,8 @@ public class PokemongService extends GenericService { if (moveSet == null) { errors.add("pokemong move set was null"); } else { - if (moveSet.size() == 0 || moveSet.size() > 4) { - errors.add("pokemong move set was empty or had more than 4 moves"); + if (moveSet.size() > 4) { + errors.add("pokemong move set had more than 4 moves"); } for (PokemongMove move : moveSet) { String moveId = move.getId(); diff --git a/src/main/resources/META-INF/openapi.yaml b/src/main/resources/META-INF/openapi.yaml index ab5d825..ba0cc4b 100644 --- a/src/main/resources/META-INF/openapi.yaml +++ b/src/main/resources/META-INF/openapi.yaml @@ -344,7 +344,6 @@ components: $ref: '#/components/schemas/Type' moveSet: type: array - minItems: 1 maxItems: 4 items: $ref: '#/components/schemas/PokemongMove'