Skip to content

Commit 2bf557c

Browse files
committed
fix: tighten isQualifiedEnumLiteral to require 2+ dots
The previous check matched any string containing a dot, which could falsely match attribute paths like "Object.Attribute". Enum literals always have the form "Module.Enum.Value" (at least 2 dots).
1 parent 53b7866 commit 2bf557c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

mdl/executor/cmd_microflows_format_action.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,5 +860,5 @@ func isMendixKeyword(s string) bool {
860860
// isQualifiedEnumLiteral returns true for qualified enum literals (e.g., "Module.Enum.Value")
861861
// that must not be prefixed with "$" when serialized as a RETURN value.
862862
func isQualifiedEnumLiteral(s string) bool {
863-
return strings.Contains(s, ".")
863+
return strings.Count(s, ".") >= 2
864864
}

sdk/mpr/writer_microflow.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ func serializeMicroflowDataType(dt microflows.DataType) bson.D {
268268
{Key: "$ID", Value: idToBsonBinary(generateUUID())},
269269
{Key: "$Type", Value: "DataTypes$StringType"},
270270
}
271-
case *microflows.DateTimeType, *microflows.DateType:
271+
case *microflows.DateTimeType, *microflows.DateType: // Both map to DataTypes$DateTimeType in BSON; Date is distinguished by LocalizeDate=false at the attribute level
272272
return bson.D{
273273
{Key: "$ID", Value: idToBsonBinary(generateUUID())},
274274
{Key: "$Type", Value: "DataTypes$DateTimeType"},

0 commit comments

Comments
 (0)