diff --git a/src/Type/String_.php b/src/Type/String_.php index 9e4ca5842..fc4e96a6e 100644 --- a/src/Type/String_.php +++ b/src/Type/String_.php @@ -9,6 +9,7 @@ use Flat3\Lodata\PathSegment\OpenAPI; use Flat3\Lodata\Primitive; use Flat3\Lodata\Property; +use UnitEnum; /** * String @@ -42,6 +43,10 @@ public static function escape(string $value): string public function set($value): self { + if ($value instanceof UnitEnum) { + $value = $value->value; + } + $this->value = null === $value ? null : (string) $value; return $this;