Repository navigation
fix: a mapping value stores the JSON member's type where it converts - #2747
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 modifydid not repair it. More recently,checkrefused 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.
checkgives exactly mxbuild's set: 22 import and 21 export pairings refused.Fix
mappingValueDataTypeandmappingTypesAlign: used by both the import and export element builders.TestMappingValueTypes, the check-gap fixture comment and README are re-measured and updated. Skills: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.create or modifywith the fix reportsModified, thenmx checkgives 0 errors.Unchanged.make ci-localpassed. The mapping tests and the skill size test were re-run on the new main.Generated by Claude Code