You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
create json structure builds different element metadata than Studio Pro — array items named "DataItem" not "Datum", root MinOccurs 0 not 1 #272
create json structure … snippet '…' produces a document whose element metadata
differs from the one Studio Pro writes for the same snippet, in two ways. Both
are silent, and both leak into every mapping built over the structure — a mapping
element clones ExposedName, MinOccurs, MaxOccurs and Nillable from the
structure it resolves against.
Measured
Studio Pro's KrogerAPI.JSON_Location (CitrusGrove demo app) beside mxcli's
structure for a snippet of the same shape ({"data": [{…}], "meta": {…}}), both
Mendix 11.13.0:
element
Studio Pro
mxcli
root (Object)
MinOccurs 1
MinOccurs 0
array item (Object)|data|(Object)
ExposedName "Datum"
"DataItem"
array item …|departments|(Object)
ExposedName "Department"
(n/a — same rule)
Studio Pro singularises the array's name for its item element — Data → Datum, Departments → Department, real English singularisation rather than
stripping a trailing "s". mxcli appends Item
(mdl/types/json_utils.go, and the elem.ExposedName + "Item" fallback in mdl/executor/cmd_export_mappings.go).
Why it matters beyond cosmetics
ExposedName is one of the two names a mapping member resolves by (#882), so a
mapping authored against an mxcli-built structure carries DataItem where the
same mapping authored in Studio Pro carries Datum. The documents are no longer
interchangeable, and a describe → exec round trip of a Studio Pro mapping over
an mxcli-rebuilt structure rewrites the stored element.
That is exactly how this was found. In the round-trip fixture
(mdl/executor/testdata/mapping-fixtures/), KrogerAPI.IM_Location — a real
Studio Pro mapping that uses nothing outside MDL's expressive range — did not
round-trip while its JSON structure was regenerated from its snippet:
Transplanting the structure verbatim instead makes the same mapping round-trip
exactly, which isolates the defect to the structure builder rather than the
mapping describer. IM_Location is now the fixture's real-document control for
that reason.
Suggested
Match Studio Pro's item naming, including the singularisation. It is worth
checking what rule Mendix actually uses (it is not a plain "drop the s" — data → Datum is Latin) before reimplementing it; a reference structure per
shape is cheap to produce.
Give the root MinOccurs 1.
A test comparing an mxcli-built structure against a Studio-Pro-built one over
the same snippet, element by element — the same methodology used for the
scheduled-event and rule documents.
Measured on 70a12365 / ed0eda6d, Mendix 11.13.0. Context: docs/11-proposals/PROPOSAL_mapping_coverage.md, and the fixture README.
An mxcli-built structure from {"title":"t","width":1,"height":2}:
Object min=0 max=1 maxLen=-1 (Object)
Value min=0 max=1 maxLen=0 title
Value min=0 max=1 maxLen=-1 width
Value min=0 max=1 maxLen=-1 height
Everything except the root's MinOccurs matches — including MaxLength 0 for
the string and -1 for the numbers, which #277 confirmed the mapping must mirror.
It surfaced because export mapping elements now mirror the bound schema element
(#277): a mapping over a Studio Pro structure gets a root MinOccurs of 1,
one over an mxcli-built structure gets 0. So the mapping side is correct and
the discrepancy is entirely here.
Measured on mxbuild 11.13. Note it is not a build error — mx check reports 0
errors either way — so it is diff churn against a Studio Pro original, the same
class as the rest of this issue.
A second instance, found while fixing #260 and again not fixed there:
create json structure does not sanitise a member name into a valid custom name.
create json structure X snippet '{"$type": "weird"}';
[error] [CE9524] "JSON element '(Object)/$type' has an invalid custom name '$type'.
Custom name should start with a letter or underscore followed by either
letters, digits or underscores."
Here the message is accurate — unlike the owner case in #300, where it
quoted a pattern the name already satisfied. capitalizeFirst("$type") is $type, which genuinely starts with an invalid character.
Studio Pro sanitises. From Evora-FactoryManagement's CRS_ModelSimulator/Request mapping, whose members contain parentheses and
spaces:
So the rule is: replace every character that is not a letter, digit or
underscore with _, then capitalise the initial — and if the result still does
not start with a letter or underscore, it needs a prefix (Studio Pro's _id / _object handling from #300 is the same mechanism).
Consequence: the 5 documents #260 lists as carrying unspellable members
($type, 43 occurrences; research%3Aread; https%3A//sws.siemens.com/sam/claims/tenantId) cannot be reproduced by mxcli at
all — a structure containing one fails to build. #260's describer fix makes such
a member describable into MDL that parses (T = "$type", since identifierOrKeyword already accepts a quoted identifier), which covers reading
an existing Studio Pro document; creating one still needs this.
Activity
test(mappings): add the DESCRIBE round-trip test, and pin JSON struct…
test(mappings): add the DESCRIBE round-trip test, and pin JSON struct…
ako commentedon Aug 27, 2026
Another instance, found while fixing #277/#279 and not fixed there (out of scope):
mxcli gives a JSON structure's ROOT element
MinOccurs 0; Studio Pro writes1.Uniform across all nine Studio Pro-authored structures pinned in
mdl/executor/testdata/mapping-fixtures/:An mxcli-built structure from
{"title":"t","width":1,"height":2}:Everything except the root's
MinOccursmatches — includingMaxLength0 forthe string and -1 for the numbers, which #277 confirmed the mapping must mirror.
It surfaced because export mapping elements now mirror the bound schema element
(#277): a mapping over a Studio Pro structure gets a root
MinOccursof 1,one over an mxcli-built structure gets 0. So the mapping side is correct and
the discrepancy is entirely here.
Measured on mxbuild 11.13. Note it is not a build error —
mx checkreports 0errors either way — so it is diff churn against a Studio Pro original, the same
class as the rest of this issue.
ako commentedon Aug 27, 2026
A second instance, found while fixing #260 and again not fixed there:
create json structuredoes not sanitise a member name into a valid custom name.create json structure X snippet '{"$type": "weird"}';Here the message is accurate — unlike the
ownercase in #300, where itquoted a pattern the name already satisfied.
capitalizeFirst("$type")is$type, which genuinely starts with an invalid character.Studio Pro sanitises. From
Evora-FactoryManagement'sCRS_ModelSimulator/Requestmapping, whose members contain parentheses andspaces:
So the rule is: replace every character that is not a letter, digit or
underscore with
_, then capitalise the initial — and if the result still doesnot start with a letter or underscore, it needs a prefix (Studio Pro's
_id/_objecthandling from #300 is the same mechanism).Consequence: the 5 documents #260 lists as carrying unspellable members
(
$type, 43 occurrences;research%3Aread;https%3A//sws.siemens.com/sam/claims/tenantId) cannot be reproduced by mxcli atall — a structure containing one fails to build. #260's describer fix makes such
a member describable into MDL that parses (
T = "$type", sinceidentifierOrKeywordalready accepts a quoted identifier), which covers readingan existing Studio Pro document; creating one still needs this.
Measured on mxbuild 11.13.
feat(json): let a script name an array's item element
feat(json): let a script name an array's item element
test(messagedefs): skip the doctype example on the legacy engine
docs(proposal): spec authorable message definitions
feat(messagedefs): grammar, AST and visitor for message definition co…
feat(messagedefs): storage — semantic type, codec writer, both engines
fix(messagedefs): three derivations corrected against a real Studio P…
feat(messagedefs): executor — create, alter, describe, show, drop
docs(messagedefs): example, skill, site reference, syntax help, finding
docs(changelog): release v0.21.0