-
Notifications
You must be signed in to change notification settings - Fork 57
Description
Summary
The JustContext.SplitGroupChar setting is not honored in the #grouparrayby transformer. Even if a custom split character (like |) is assigned to context.SplitGroupChar, the grouping logic still uses : internally, causing unexpected behavior when grouping by fields that contain : — such as DateTime strings.
Steps to Reproduce
Use a JSON input array with a fromDate field containing a full ISO timestamp, e.g. "2022-01-01T00:00:00".
Set a custom group split character in C#:
var context = new JustContext();
context.GroupBySplitChar = "|";
Use the following rule:
{
"transformationRules": {
"Result": "#grouparrayby($,payrollUnit|fromDate,all)"
}
}
Run transformation with this context and input.
Expected Result
Grouping should succeed using payrollUnit and fromDate as the group key, preserving the full fromDate value (e.g., "2022-01-01T00:00:00").
Actual Result
The fromDate value is truncated (e.g., becomes "2022-01-01T00").
Root Cause
In the JUST.NET source code (likely in Utilities.cs), the group key string is split using a hardcoded colon (:), rather than using context.SplitGroupChar.
Suggested Fix
Update the relevant grouping logic to use context.SplitGroupChar instead of ':'. This will allow safe grouping on fields like DateTime that contain : and aligns with the design of JustContext.``