Repository navigation
Description
1. mxcli version: nightly-20261130-b8a764c54 (Windows); also seen on v0.34.0
2. Mendix version: 11.12.8
Repro app: a fresh mxcli new app, built by the script below
3. Scenario
create import mapping (and create or modify import mapping) stores the type of the bound attribute on each value element (Type and XmlPrimitiveType), not the type of the JSON structure member it binds. When the two differ, for example a numeric member "code": 123 bound to a String attribute, mx check reports CE5015 ("The mapping does not align with the underlying schema anymore"). mxcli check --references and exec pass, and describe round-trips cleanly because the element type is not part of MDL, so nothing points at the problem until mx check or Studio Pro. This looks like the import-mapping counterpart of #1954 (export mapping, fixed in v0.34.0); #1387 is another export-mapping CE5015.
Self-contained repro, run in an empty directory:
#!/usr/bin/env bash
# Repro: create import mapping binds a JSON Integer element to a String attribute with the
# attribute's type on the value element instead of the schema's type -> mx check CE5015.
# Needs mxcli and mx (Studio Pro's, or mxcli docker check).
set -e
cd "$(dirname "$0")"
export MXCLI_LOG_DIR="$PWD/logs" # own log dir: the diag only holds this repro
P=Repro/Repro.mpr
mxcli new Repro --version 11.12.8 --skip-build --skip-init > /dev/null
cat > step1.mdl <<'MDL'
mdl 1;
create non-persistent entity MyFirstModule.Sale (
Code: String(200),
Quantity: Integer
);
create json structure MyFirstModule.JSON_Sale
sample '{"code": 123, "quantity": 5}';
create import mapping MyFirstModule.IMM_Sale
with json structure MyFirstModule.JSON_Sale
{
create MyFirstModule.Sale {
Code = code,
Quantity = quantity
}
};
MDL
mxcli check step1.mdl -p $P --references | tail -1
mxcli -p $P exec step1.mdl
mxcli -p $P -c "describe import mapping MyFirstModule.IMM_Sale;"
# The mapping unit is BSON; JSON paths and value types are plain strings in it, in element order.
U=$(grep -rla 'IMM_Sale' Repro/mprcontents | xargs grep -la 'ImportMappings\$ImportMapping')
grep -ao '(Object)|[a-z]*\|DataTypes\$[A-Za-z]*Type' "$U"
mxcli docker check -p $P || trueOutput (progress lines left out):
Check passed!
Connected to: Repro/Repro.mpr (Mendix 11.12.8)
Created entity: MyFirstModule.Sale
Created json structure: MyFirstModule.JSON_Sale
Created import mapping MyFirstModule.IMM_Sale
mdl 1;
create or modify import mapping MyFirstModule.IMM_Sale
with json structure MyFirstModule.JSON_Sale
{
create MyFirstModule.Sale {
Code = code,
Quantity = quantity
}
};
(Object)|code
DataTypes$StringType
(Object)|quantity
DataTypes$IntegerType
DataTypes$UnknownType
Using mx: C:\Program Files\Mendix\11.12.8\modeler\mx.exe
[error] [CE5015] "The mapping does not align with the underlying schema anymore. Please right-click on this error and select 'Resolve by updating from schema' to update the mapping. Details: Attribute type 'String' does not match schema type 'Integer' of element '(Object)/code'." at Value mapping element 'Code'
The app contains: 1 errors.
Error: project check failed: exit status 1
4. Expected output
- Each value element stores the type of the JSON structure member it binds (
code→DataTypes$IntegerType,XmlPrimitiveTypeInteger), whatever the type of the attribute. That is what a mapping made in Studio Pro stores for an Integer member bound to a String attribute, andmx checkaccepts it. create or modifyof an existing mapping keeps the member types that are already stored.- Until then:
mxcli check --referenceswarns when a bound attribute's type differs from the member type, instead ofCheck passed!.
5. Experienced output
Stored types, from the grep in the repro and the variants below. The last DataTypes$UnknownType in the repro output is the mapping's own ParameterType, not a value element.
| JSON member (sample) | Schema type | Bound attribute | Stored Type |
mx check |
|---|---|---|---|---|
code (123) |
Integer | Code: String(200) |
DataTypes$StringType (XmlPrimitiveType String) |
CE5015 |
quantity (5) |
Integer | Quantity: Integer |
DataTypes$IntegerType |
no error |
rate (1.5) |
Decimal | Rate: String(200) |
DataTypes$StringType |
CE5015 |
count ("7") |
String | Count: Integer |
DataTypes$IntegerType |
CE5015 |
describe import mapping prints Code = code, so a round-trip doesn't show the problem. create or modify on an existing mapping re-derives every value element the same way: elements that Studio Pro had stored with the member type, and that passed mx check, switch to the attribute type even when their MDL line is unchanged.
Other spellings tried (same nightly, a second fresh app with the same step1.mdl):
create or modify import mapping MyFirstModule.IMM_Salewith the same body →Unchanged import mapping MyFirstModule.IMM_Sale;codestaysDataTypes$StringType, so a re-run doesn't repair it.- Decimal member into a String attribute (
sample '{"rate": 1.5}',Rate: String(200),Rate = rate) →Check passed!, then[error] [CE5015] ... Details: Attribute type 'String' does not match schema type 'Decimal' of element '(Object)/rate'." at Value mapping element 'Rate' - String member into an Integer attribute (
sample '{"count": "7"}',Count: Integer,Count = count) →Check passed!, then[error] [CE5015] ... Details: Attribute type 'Integer' does not match schema type 'String' of element '(Object)/count'." at Value mapping element 'Count' - There is no MDL to state the member type:
mxcli syntax import-mappingoffersAttr = jsonField [KEY],Attr = a/b/cand value transforms only.
6. AI bug report
mxcli diag of the repro run:
Version: nightly-20261130-b8a764c54
Go: go1.27.4 windows/amd64
Sessions: 5 (last 7 days)
Errors: 0 (last 7 days)
Session log of -p Repro/Repro.mpr exec step1.mdl (from mxcli diag --bundle):
{"time":"2026-11-30T21:26:45.1335144+01:00","level":"INFO","msg":"session_start","version":"nightly-20261130-b8a764c54","go":"go1.27.4","os":"windows","arch":"amd64","mode":"mxcli exec","args":["mxcli","-p","Repro/Repro.mpr","exec","step1.mdl"],"pid":19140,"parent_pid":""}
{"time":"2026-11-30T21:26:45.9522161+01:00","level":"INFO","msg":"execute","stmt_type":"CreateEntityStmt","stmt_summary":"create entity MyFirstModule.Sale","duration_ms":14}
{"time":"2026-11-30T21:26:46.0347701+01:00","level":"INFO","msg":"execute","stmt_type":"CreateJsonStructureStmt","stmt_summary":"CreateJsonStructureStmt","duration_ms":42}
{"time":"2026-11-30T21:26:46.0865826+01:00","level":"INFO","msg":"execute","stmt_type":"CreateImportMappingStmt","stmt_summary":"CreateImportMappingStmt","duration_ms":51}
{"time":"2026-11-30T21:26:46.1198119+01:00","level":"INFO","msg":"session_end","commands_executed":4,"errors_count":0,"duration_s":0,"pid":19140}
exec logs CreateImportMappingStmt without an error (errors_count: 0); the wrong type only surfaces in mx check.
Why it matters
JSON structures are generated from a sample payload, and sample payloads often carry IDs and reference numbers as numbers (123, 0) while the entity stores them as strings. Any import mapping that mxcli writes or rewrites with such a binding gets CE5015, so the app no longer builds, while every mxcli check is green. Rewriting a large existing mapping to add one nested block is enough to hit it on elements nobody touched. Workaround: map those members in Studio Pro (the CE5015 message suggests right-click → "Resolve by updating from schema"), or make the sample's member type match the attribute where the real payload allows it.
Activity
julesschilperoort1994 commentedon Nov 30, 2026
A second case of the same rewrite, on the object side: an entity mapped onto an empty JSON array
mxcli version: nightly-20261130-b8a764c54 (Windows); also seen on v0.34.0
Mendix version: 11.12.8
Repro app: a fresh
mxcli newapp, built by the script belowWhen the sample has an empty array (
"tags": []), the JSON structure element is anArraywithout an item. Studio Pro maps an entity onto that array element and stores the object mapping element withElementTypeArray;describe import mappingprints it ascreate Assoc/Module.Entity = tags,. mxcli writes that binding withElementTypeObject, andmx checkreports CE5015 "Element '(Object)/tags' is not a Object element".mxcli check --referencesandexecpass. So adescribe→create or modifyround-trip of a mapping made in Studio Pro breaks this element even when nobody edited it (seen that way on v0.34.0).Self-contained repro, run in an empty directory:
Output (progress lines left out):
Expected: the object mapping element takes its
ElementTypefrom the JSON structure element it binds (Arrayhere), as Studio Pro stores it, so a round-trip keeps it. Until then:mxcli check --referenceswarns about the binding instead ofCheck passed!.Other spellings tried (same nightly, against the repro app):
create MyFirstModule.Tags_Sale/MyFirstModule.Tags = tags { }→Syntax errors found:line 7:63 mismatched input '}' expecting the start of a statement (create, alter, drop, show, describe, …)create MyFirstModule.Tags_Sale/MyFirstModule.Tags = tags { Note = note }→mxcli check --references:Check passed!;exec:Error: import mapping MyFirstModule.IMM_Sale: "note" is not a member of the JSON structure at (Object)|tags|(Object), which has no members theremxcli syntax import-mappingdocuments no form for an entity on an empty array.AI bug report
mxcli diagof the repro run:Session log of
-p Repro/Repro.mpr exec step1.mdl(frommxcli diag --bundle):execlogsCreateImportMappingStmtwithout an error (errors_count: 0); the wrong element type only surfaces inmx check.Workaround: Studio Pro's "Resolve by updating from schema" on the CE5015 sets the element back to
Array.julesschilperoort1994 commentedon Dec 1, 2026
A third case: a value element with a converter (Convert using)
mxcli version: nightly-20261130-b8a764c54 (Windows); also seen on v0.34.0
Mendix version: 11.12.8
Repro app: a fresh
mxcli newapp, built by the script belowA String member (
"paid": "Ja") is converted to a Boolean attribute with a converter microflow (Paid = Module.Convert(paid)). mxcli stores the value element with the attribute's type,DataTypes$BooleanType, somx checkreports CE5015 "Attribute type 'Boolean' does not match schema type 'String'". A mapping where Studio Pro set the same kind of converter (String member, String → Boolean microflow, Boolean attribute) storesDataTypes$StringTypeon that element and checks with 0 errors.mxcli check --referencesandexecpass.Self-contained repro, run in an empty directory:
Output (progress lines left out):
Expected: an element with a converter stores the JSON member's type, like every other value element. Studio Pro does the same; the converter's return type matches the attribute, its parameter matches the member.
Also worth knowing: in a larger mapping with several misaligned elements,
mx checkreported only one CE5015. After a fix, re-runmx checkuntil it's clean, because the next misaligned element only shows up once the first is resolved.AI bug report
mxcli diagof the repro run:Session log of
-p Repro/Repro.mpr exec step1.mdl(frommxcli diag --bundle):execlogsCreateImportMappingStmtwithout an error (errors_count: 0); the wrong element type only surfaces inmx check.