Skip to content

fix: a mapping value stores the JSON member's type where it converts - #2747

Merged
ako merged 2 commits into
mainfrom
claude/issue-triage-prioritization-24rqgv
Dec 2, 2026
Merged

ako merged 2 commits into
mainfrom
claude/issue-triage-prioritization-24rqgv

Conversation

@ako

@ako ako commented Dec 2, 2026

Copy link
Copy Markdown
Owner

Fixes #2714 (upstream mendixlabs#2001).

Problem

An import mapping binding a JSON integer member ("code": 123) to a String attribute stored the value element with the attribute's type (DataTypes$StringType). mxbuild compares that type with the schema member and reported CE5015 ("Attribute type 'String' does not match schema type 'Integer'"). create or modify did not repair it. More recently, check refused the pairing outright as MDL127, calling it an exact-match rule.

What the measurement showed

MDL127's table ("the two types must match exactly", check-gap sweep, #1258) was measured while the writer stored the attribute's type. It describes what mxcli's writes built, not what Mendix accepts. I re-measured on 11.12.6, in one project: 5 member types × 7 attribute types, import and export, one element per pairing.

  • Storing the member's type everywhere is wrong too. A string member bound to a DateTime attribute then fails (CE6099 / CE0227); it builds only with the attribute's type stored.
  • Mixed rule:
    • Where the attribute's type aligns with the member's (integer → Integer/Long/AutoNumber, string → String/Enumeration/DateTime, same type), store the attribute's type, as before.
    • Otherwise store the member's type.
  • With the mixed rule, mxbuild accepts:
    • on import, any member into a String attribute, and an integer into a Decimal;
    • on export, a String attribute into any member, and an Integer or Long into a decimal member.
    • Every other pairing fails: CE6099 on import, CE0227 on export.
  • MDL127 matches mxbuild. Running the same matrix through check gives exactly mxbuild's set: 22 import and 21 export pairings refused.

Fix

  • mappingValueDataType and mappingTypesAlign: used by both the import and export element builders.
  • MDL127 follows the measured table per side and names CE6099 / CE0227 instead of CE5015.
  • TestMappingValueTypes, the check-gap fixture comment and README are re-measured and updated. Skills:
    • json-structures-and-mappings: a row in Common Mistakes.
    • connect-rapidminer-graph: an ISO timestamp member into a String attribute now builds.

Evidence

  • mdl/executor/mapping_value_type_2714_test.go: with the old behaviour, 4 rows fail. Controls (aligned pairs keep the attribute's type, String→DateTime needs DateTime, no structure or unknown member type falls back) hold.
  • Live, Mendix 11.12.6, the reporter's mapping:
    • The pre-fix binary gives CE5015.
    • create or modify with the fix reports Modified, then mx check gives 0 errors.
    • A re-run reports Unchanged.
  • make ci-local passed. The mapping tests and the skill size test were re-run on the new main.

Generated by Claude Code

An import mapping binding a JSON integer to a String attribute stored the
value element with the attribute's type; mxbuild compares that with the
schema member and reported CE5015. A value element now stores the
attribute's type where it aligns with the member (an integer into Long, a
string into DateTime, which needs it) and the member's type otherwise, for
import and export alike. MDL127's "exact match" table had been measured
against the old writes; re-measured over every member x attribute pairing
on 11.12.6, it now accepts the conversions mxbuild accepts and names
CE6099 / CE0227 for the rest.

Fixes #2714

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oK82qrr1WnXxq1eRn7qRJ
MxGenAIConnector.IM_Collection_RetrieveNearestNeighbors stores
DataTypes$IntegerType for a value bound to a Decimal attribute, which
knownLossy recorded as the one difference a rebuild made. With the
member's type stored where the mapping converts (#2714) the
rebuild matches it, and the fixture test asks for the entry to go.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011oK82qrr1WnXxq1eRn7qRJ
@ako
ako merged commit af7cc7d into main Dec 2, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants