From b255ef43202fabcf195342dc9e4e839fd294a72e Mon Sep 17 00:00:00 2001 From: Toon Verwerft Date: Tue, 2 Apr 2024 15:56:46 +0200 Subject: [PATCH] Allow empty enumeration strings --- src/Metadata/Model/TypeMeta.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Metadata/Model/TypeMeta.php b/src/Metadata/Model/TypeMeta.php index c01beef..7058c17 100644 --- a/src/Metadata/Model/TypeMeta.php +++ b/src/Metadata/Model/TypeMeta.php @@ -11,6 +11,7 @@ use function Psl\Type\non_empty_string; use function Psl\Type\optional; use function Psl\Type\shape; +use function Psl\Type\string; use function Psl\Type\vec; final class TypeMeta @@ -31,7 +32,7 @@ final class TypeMeta private $docs; /** - * @var list|null + * @var list|null */ private $enums; @@ -171,7 +172,7 @@ public function withDocs(?string $docs): self } /** - * @return Option> + * @return Option> */ public function enums(): Option { @@ -184,7 +185,7 @@ public function enums(): Option public function withEnums(?array $enums): self { $new = clone $this; - $new->enums = optional(vec(non_empty_string()))->coerce($enums); + $new->enums = optional(vec(string()))->coerce($enums); return $new; }