Skip to content

Double-quoted identifiers inside a create import mapping { } body are not stripped, causing CE1613 on every reference #842

Description

@MendixMau

Environment: mxcli (RnD/upstream, v0.16.0), Mendix 11.12.1 project.

Steps to reproduce:

create module ZZB;
/

create non-persistent entity ZZB."Routing" (
  "RoutingCode": String(100),
  "RoutingName": String(200)
);
/

create json structure ZZB."JSON_R09"
  snippet $${"routing_code":"RT-PCBA-001","routing_name":"Routing for PCBA line 1"}$$;
/

create import mapping ZZB."IMM_R09"
  with json structure ZZB."JSON_R09"
{
  create ZZB."Routing" {
    "RoutingCode" = routing_code,
    "RoutingName" = routing_name
  }
};

Run mxcli exec script.mdl -p project.mpr, then compile with the real Mendix validator
(mx check / Studio Pro).

Expected behavior: Double-quoted identifiers are a normal, encouraged way to write entity
and attribute names in MDL (needed to avoid collisions with reserved keywords). Quotes should
be stripped consistently everywhere an identifier appears, including inside an import
mapping's create/assignment body.

Actual behavior: mxcli exec reports success for every statement, including the mapping,
with no warning. Compiling with the real validator surfaces the defect:

[error] [CE1613] "The selected entity 'ZZB."Routing"' no longer exists." at Object mapping element 'Root'
[error] [CE1613] "The selected attribute 'ZZB."Routing".RoutingCode' no longer exists." at Value mapping element 'Routing_code'
[error] [CE1613] "The selected attribute 'ZZB."Routing".RoutingName' no longer exists." at Value mapping element 'Routing_name'
The app contains: 3 errors.

Note the error text itself: 'ZZB."Routing"' — the literal " characters are baked into the
stored reference string, confirming the mapping-body parser never stripped them. The mapping
looks like it references a nonexistent entity/attributes even though ZZB.Routing and its
attributes exist and are spelled correctly (once you remove the redundant quoting).

Root cause (not yet diagnosed at source level): everywhere else in mxcli, quoting is
stripped generically at the parser/lexer level for identifiers. The import-mapping body
appears to resolve entity/attribute references through a different path — likely a string
lookup against already-created entities/attributes rather than a parsed identifier token —
that never runs through the same stripping logic. Reproduces identically on both
mendixlabs/mxcli and engalar/mxcli (byte-for-byte error text on both, including the
leaked quote characters), which points to a long-standing shared code path rather than a
regression in either fork.

Workaround: omit the quotes on identifiers written inside an import-mapping body
specifically — inconsistent with every other MDL context, where quoting is the safer default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions