From aadd7a5a7c23eed8c1ad27864140c4b6b872090c Mon Sep 17 00:00:00 2001 From: Pavel Merzlyakov Date: Fri, 2 Feb 2024 11:02:54 +0300 Subject: [PATCH] fix generating json tag for enum --- src/codegen.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/codegen.inc.php b/src/codegen.inc.php index 3bbbdaf..505fe4d 100644 --- a/src/codegen.inc.php +++ b/src/codegen.inc.php @@ -330,7 +330,8 @@ function add_twig_filters(\Twig\Environment $twig) function(\mtgMetaField $field): string { $tag = get_field_alias_or_name($field); $type = $field->getType(); - if($type instanceof \mtgBuiltinType && !$type->isString() && !$type->isBlob()) { + if($type instanceof \mtgMetaEnum || + ($type instanceof \mtgBuiltinType && !$type->isString() && !$type->isBlob())) { return $tag.',string'; } return $tag;