From dd3773b821abb30561035226eb95f73a853c8987 Mon Sep 17 00:00:00 2001 From: Pavel Shevaev Date: Mon, 30 Sep 2024 20:29:13 +0300 Subject: [PATCH] Specifying enum default value as 0 if it contains no items --- tpl/macro.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tpl/macro.twig b/tpl/macro.twig index 161daa1..6abfe5f 100644 --- a/tpl/macro.twig +++ b/tpl/macro.twig @@ -258,7 +258,7 @@ class {{o.name}} {{ _self.enum_values(o) }} - const DEFAULT_VALUE = {{o.values | first}}; + const DEFAULT_VALUE = {{o.values|length > 0 ? o.values | first : 0}}; function getClassId() {