Skip to content

Document placement gaps: FOLDER is a silent no-op on an existing document, and mappings/JSON structures cannot be foldered or MOVEd at all #932

Description

@Chendodelangen

Summary

Placing documents in folders works for some document types and silently fails for others. Found while cleaning up a connector module for handover: three JSON structures and three import mappings sat in the module root next to Domain model and Security, and only the structures could be moved - after a detour.

Environment: mxcli v0.18.0 (2026-08-14T20:29:13Z), Windows, Mendix 11.12.2.

Bug 1 - FOLDER is a silent no-op on an existing document

CREATE OR MODIFY JSON STRUCTURE Module.JSON_Example
  FOLDER 'Private/JSON Structures'
  SNIPPET '{"result": [{"id": 1}]}'
  CUSTOM NAME map ('id' as '_id');

On a document that already exists, mxcli reports

Modified json structure: Module.JSON_Example

and the document stays where it was. describe jsonstructure afterwards shows no folder. The same statement on a document that does not exist yet places it correctly, so the clause is only honored on CREATE.

Workaround that does work, and it is heavier than it should be: DROP the dependent import mapping, DROP the structure, CREATE the structure with FOLDER, CREATE the mapping again, then re-execute every script that referenced the mapping so the microflows rebind.

Expected: either apply the folder on modify, or fail loudly with "folder changes are not supported on an existing document" - anything except reporting success for a write that did not happen.

Bug 2 - IMPORT MAPPING has no FOLDER clause, and MOVE does not cover it

CREATE OR MODIFY IMPORT MAPPING Module.IMM_Example
  WITH JSON STRUCTURE Module.JSON_Example
  FOLDER 'Private/Import mappings'
{ ... }
Parse error: line 3:2 mismatched input 'FOLDER' expecting '{'

MOVE is no way out either:

MOVE IMPORT MAPPING Module.IMM_Example TO FOLDER 'Private/Import mappings';
MOVE IMPORTMAPPING  Module.IMM_Example TO FOLDER 'Private/Import mappings';
Parse error: no viable alternative at input 'MOVEIMPORT'
Parse error: no viable alternative at input 'MOVEIMPORTMAPPING'

mxcli syntax documents the supported doctypes as PAGE | MICROFLOW | NANOFLOW | SNIPPET | ENUMERATION | CONSTANT plus JAVA ACTION and ODATA SERVICE. Import mappings, export mappings and JSON structures are missing, so a module built entirely through MDL cannot put its mappings in the folder layout the conventions ask for. Ours stay in the module root until someone drags them by hand, which is the one step a scripted build should not need.

Expected: FOLDER on the create/modify statement for mappings and structures, or MOVE IMPORT MAPPING | EXPORT MAPPING | JSON STRUCTURE ... TO FOLDER.

Side note (no action needed, for context)

While recreating a structure we also learned that the schema type is inferred from the sample value: "write_date": "2026-07-20 03:00:00" yields schema type DateTime, and a mapping onto a String attribute then blocks the export with "The mapping does not align with the underlying schema anymore". Using "x" as the sample value keeps it String. That is Mendix behaving correctly, but a note in the docs next to CUSTOM NAME map would have saved us a bisect round.

Related: #892 (DROP FOLDER deletes JSON structures that LIST FOLDERS does not count), #841 (create json structure occurrence bounds, closed).

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