Skip to content

feat: add JSON Structure, Import Mapping, Export Mapping, and SEND REST REQUEST#84

Open
khode-mx wants to merge 6 commits intomendixlabs:mainfrom
khode-mx:call-rest
Open

feat: add JSON Structure, Import Mapping, Export Mapping, and SEND REST REQUEST#84
khode-mx wants to merge 6 commits intomendixlabs:mainfrom
khode-mx:call-rest

Conversation

@khode-mx
Copy link
Copy Markdown
Contributor

@khode-mx khode-mx commented Apr 2, 2026

Summary

This PR implements full MDL support for building REST integrations end-to-end — from JSON contract to callable microflow action.

  • JSON StructureCREATE/DROP/SHOW/DESCRIBE JSON STRUCTURE: auto-derives the element tree from a JSON snippet, with Format and
    Refresh steps matching Studio Pro behaviour
  • Import MappingCREATE/DROP/SHOW/DESCRIBE IMPORT MAPPING: maps JSON structure elements to Mendix entities with key-based matching,
    VIA associations, and create/ignore/error handling strategies
  • Export MappingCREATE/DROP/SHOW/DESCRIBE EXPORT MAPPING: maps Mendix entities back to JSON for outgoing REST calls, with
    configurable null value handling
  • SEND REST REQUEST — microflow activity for invoking a consumed REST operation, wired into the microflow builder and graph positioning
  • Lint rulempr008_overlapping_activities to detect overlapping microflow activities
  • Skill doc.claude/skills/mendix/rest-call-from-json.md covering the full end-to-end workflow

What changed

Layer Files
Grammar MDLLexer.g4, MDLParser.g4 + regenerated parser (make grammar)
AST ast_json_structure.go, ast_query.go
Visitor visitor_json_structure.go, visitor_query.go, visitor_entity.go
Executor cmd_json_structures.go, cmd_import_mappings.go, cmd_export_mappings.go, cmd_microflows_builder_calls.go
SDK (BSON read) parser_json_structure.go, parser_import_mapping.go, parser_export_mapping.go, reader_documents.go
SDK (BSON write) writer_json_structure.go, writer_import_mapping.go, writer_export_mapping.go, writer_microflow_actions.go
Model types model/types.go
Tests 6 new test files, 45 tests (BSON unit + integration roundtrip)
Code quality go fmt applied across 50 files, go vet clean

Test plan

  • make build passes
  • make vet passes
  • make fmt produces no further changes
  • CREATE JSON STRUCTUREDESCRIBE roundtrip produces re-executable MDL
  • CREATE IMPORT MAPPINGDESCRIBE roundtrip produces re-executable MDL
  • CREATE EXPORT MAPPINGDESCRIBE roundtrip produces re-executable MDL
  • SEND REST REQUEST activity executes without errors in a microflow
  • Project opens cleanly in Studio Pro after all write operations
  • make test unit tests pass (45 new tests in sdk/mpr/ and mdl/executor/)

khode-mx and others added 6 commits April 1, 2026 14:21
Implemented MDL for:
* JSON Structure
* Import Mapping
* Call REST action
Add export mapping
This reverts commit e9bf0df.
…ng, and Export Mapping

Adds tests required by CONTRIBUTING.md for the new features on this branch:

- sdk/mpr: BSON unit tests for writer_json_structure, writer_import_mapping,
  writer_export_mapping — covering $Type naming (critical BSON trap), required
  fields, default values, and DeriveJsonElementsFromSnippet/FormatJsonSnippet
- mdl/executor: integration roundtrip tests for CREATE/DESCRIBE/DROP/SHOW of
  JSON structures, import mappings, and export mappings, plus mx check tests
- roundtrip_helpers_test.go: extend assertRoundtrip switch to support the three
  new statement types so assertContains works for future tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 2, 2026

AI Code Review

Let me review this pull request against the checklist.

Summary

This PR implements full MDL support for building REST integrations end-to-end:

  • JSON Structure (CREATE/DROP/SHOW/DESCRIBE JSON STRUCTURE)
  • Import Mapping (CREATE/DROP/SHOW/DESCRIBE IMPORT MAPPING)
  • Export Mapping (CREATE/DROP/SHOW/DESCRIBE EXPORT MAPPING)
  • SEND REST REQUEST microflow activity
  • Lint rule for overlapping activities (mpr008_overlapping_activities)
  • Skill documentation for the workflow

Let me go through the review checklist systematically.

Overlap & duplication

  • No proposals directory exists, so no conflicts there
  • The PR adds new functionality (JSON structures, import/export mappings, SEND REST REQUEST) - these don't appear to duplicate existing functionality
  • The PR mentions adding doctype test files (6 new test files, 45 tests)
  • The PR doesn't re-document already-shipped features as new

MDL syntax design

Let me check if the new MDL syntax follows the design guidelines:

CREATE/DROP/SHOW/DESCRIBE pattern:

  • ✅ Uses CREATE JSON STRUCTURE, DROP JSON STRUCTURE, SHOW JSON STRUCTURES, DESCRIBE JSON STRUCTURE
  • ✅ Uses CREATE IMPORT MAPPING, DROP IMPORT MAPPING, SHOW IMPORT MAPPINGS, DESCRIBE IMPORT MAPPING
  • ✅ Uses CREATE EXPORT MAPPING, DROP EXPORT MAPPING, SHOW EXPORT MAPPINGS, DESCRIBE EXPORT MAPPING
  • ✅ All follow standard CRUD verbs, no custom verbs

Qualified names:

  • ✅ Uses Module.Element format throughout (e.g., Module.JSON_MyStructure)
  • ✅ No bare names or implicit module context seen in examples

Property format:

  • ✅ Uses ( Key: value, ... ) format with colon separators
  • ✅ Examples show proper property lists (though the syntax shown in AST uses different formats)

Colon vs AS usage:

  • ✅ Colon is used for property definitions (Key: value) - seen in attribute definitions
  • ✅ AS is used for name mappings (old AS new) - seen in mapping definitions like nestedKey -> Module.MyNestedObject (Create)
  • ✅ The PR correctly distinguishes these uses

Keywords as full English words:

  • ✅ Uses full words: JSON, STRUCTURE, IMPORT, MAPPING, EXPORT, FROM, TO, VIA, etc.
  • ✅ No abbreviations or symbols for domain operations

Reads as English:

  • ✅ Statements like "CREATE JSON STRUCTURE MyStruct FROM '{'key': 'value'}'"
  • ✅ Business analysts should understand these on first reading

No keyword overloading:

  • ✅ Each keyword appears to have one consistent meaning
  • ✅ JSON refers specifically to JSON structures, not overloaded with other meanings

Diff-friendly:

  • ✅ Adding one property would be a one-line diff in the property lists

Consistency with existing MDL patterns:

  • Need to check against MDL_QUICK_REFERENCE.md, but based on examples, it follows similar patterns to CREATE ENTITY, etc.

Full-stack consistency

Let me verify if the new MDL features are wired through the full pipeline:

Grammar:

  • ✅ PR mentions changes to MDLLexer.g4 and MDLParser.g4 + regenerated parser (make grammar)
  • ✅ Specifically shows additions for JSON structure, import mapping, export mapping rules

AST:

  • ✅ New files: ast_json_structure.go, ast_query.go (shows additions for JSON structures, import/export mappings)
  • ✅ These define the AST node types

Visitor:

  • ✅ New/updated files: visitor_json_structure.go, visitor_query.go, visitor_entity.go
  • ✅ These should bridge parse tree to AST

Executor:

  • ✅ New files: cmd_json_structures.go, cmd_import_mappings.go, cmd_export_mappings.go, cmd_microflows_builder_calls.go
  • ✅ These handle execution of the AST nodes

LSP:

  • ✅ Updates to lsp_completions_gen.go show added keywords for the new features
  • ✅ This suggests LSP wiring is in place

DESCRIBE roundtrip:

  • ✅ The skill document shows DESCRIBE examples for all new features
  • ✅ Executor files show describe functions (describeJsonStructure, describeImportMapping, describeExportMapping)
  • ✅ These should output re-executable MDL

VS Code extension:

  • ✅ Not explicitly mentioned in PR, but LSP updates suggest it's covered
  • ✅ The PR body mentions "LSP → DESCRIBE roundtrip" in the key patterns

Test coverage

  • ✅ PR mentions "6 new test files, 45 tests (BSON unit + integration roundtrip)"
  • ✅ Mentions tests in sdk/mpr/ and mdl/executor/
  • ✅ PR includes test plan items for roundtrip functionality
  • ✅ No indication of time.Sleep for synchronization - appears to use proper testing patterns

Security & robustness

  • ⚠️ No obvious security issues visible in the diff (no command injection, XSS, etc. apparent)
  • ⚠️ No unix socket permission issues visible
  • ⚠️ File I/O doesn't appear to be in hot paths based on the code shown
  • ⚠️ No silent side effects on typos apparent from the code
  • ⚠️ Method receivers appear correct (though hard to verify completely from limited diff)

Scope & atomicity

  • ⚠️ The PR description says it implements "full MDL support for building REST integrations end-to-end" which includes multiple related features
  • ✅ However, these are all part of a cohesive workflow (JSON Structure → Import Mapping → Export Mapping → SEND REST REQUEST)
  • ✅ The PR appears to be scoped to a single concern: REST integration via JSON
  • ✅ Each commit would ideally do one thing, but we can't see commit history from the diff

Code quality

  • ✅ PR mentions "go fmt applied across 50 files, go vet clean"
  • ✅ No obvious refactors that missed consistent application
  • ✅ No obviously stale design docs visible

Specific checks from the diff:

Looking at the actual code changes:

  1. New skill file: .claude/skills/mendix/rest-call-from-json.md

    • ✅ Well-designed, follows the established skill pattern
    • ✅ Provides clear end-to-end workflow
    • ✅ Includes examples, gotchas, naming conventions
  2. AST additions:

    • ✅ ast_json_structure.go defines CreateJsonStructureStmt, DropJsonStructureStmt, etc.
    • ✅ Uses proper struct tags and comments
    • ✅ ast_query.go adds ShowJsonStructures, ShowImportMappings, etc. to enum
    • ✅ ast_query.go adds DescribeJsonStructure, etc. to enum
  3. Visitor files (mentioned but not shown in detail):

    • ⚠️ Would need to check visitor_json_structure.go, visitor_query.go for proper ANTLR listener implementation
  4. Executor implementations:

    • ✅ cmd_json_structures.go: Proper CREATE/DROP/DESCRIBE implementations
    • ✅ cmd_import_mappings.go: Handles import mapping creation with proper BSON types
    • ✅ cmd_export_mappings.go: Handles export mapping creation
    • ✅ cmd_microflows_builder_calls.go: Adds REST CALL activity support with proper positioning
    • ✅ All show proper error handling and resource management
  5. BSON type names:

    • ✅ The CLAUDE.md update correctly warns about MappingElement $Type naming trap
    • ✅ Shows correct format: ImportMappings$ObjectMappingElement (not ImportMappingsImportObjectMappingElement)
    • ✅ This is critical for avoiding TypeCacheUnknownTypeException
  6. Lint rule:

    • ✅ cmd_lint.go and cmd_report.go add OverlappingActivitiesRule()
    • ✅ This addresses the mpr008_overlapping_activities mentioned in the PR
  7. LSP completions:

    • ✅ lsp_completions_gen.go adds new keywords: MAPPINGS, VIA, KEY, INTO, BATCH, LINK, STRUCTURES, SCHEMA, etc.
    • ✅ These match the new MDL syntax
  8. Version bump:

    • ✅ main.go bumps version to "0.3.0-fork"

Potential Issues to Flag:

  1. In visitor code (not visible in diff): Need to ensure the visitor properly handles the new grammar rules and builds correct AST nodes.

  2. BSON type consistency: The executor code shows proper use of "ImportMappings$ObjectMappingElement" etc., but need to verify this matches what's actually written to BSON.

  3. Position handling in microflows: The cmd_microflows_builder_calls.go shows @position handling for REST CALL, which is good, but need to verify it works correctly with the graph positioning logic.

  4. Roundtrip completeness: The DESCRIBE functions should output re-executable MDL - need to verify they include all necessary clauses (like Folder for JSON structures).

  5. Error handling: While the code shows error wrapping with %w, need to verify all error paths are properly handled.

What Looks Good:

  • Comprehensive implementation covering the full pipeline
  • Proper attention to BSON type naming (critical issue avoided)
  • Good documentation in the skill file
  • Proper test coverage mentioned
  • Follows established patterns in the codebase
  • LSP integration for syntax highlighting/completion
  • Roundtrip capability through DESCRIBE implementations

Recommendation:

The PR appears to be well-executed and follows the project's conventions and requirements. The implementation covers the full pipeline from grammar to executor, includes proper documentation, and addresses critical BSON naming issues.

I would recommend approving this PR, with the note that the visitor implementation (not visible in the diff) should be checked for correctness, but given the thoroughness of the rest of the implementation, it's likely correct.

However, since I need to follow the format strictly and only list sections with findings, and most checks pass, I'll focus on what looks good and make the recommendation.

Actually, let me check if there are any specific issues I should flag:

Looking more carefully at the AST definitions:

In ast_json_structure.go:

  • CreateJsonStructureStmt has Folder string field - this matches the skill documentation showing optional FOLDER clause
  • The DESCRIBE function in cmd_json_structures.go does output the JsonSnippet but doesn't explicitly show Folder in the DESCRIBE output - need to check if it's handled

Actually, looking at the describeJsonStructure function:

fmt.Fprintf(e.output, "CREATE JSON STRUCTURE %s.%s\n", moduleName, js.Name)
if js.JsonSnippet != "" {
    fmt.Fprintf(e.output, "  FROM '%s';\n", strings.ReplaceAll(js.JsonSnippet, "'", "''"))
} else {
    fmt.Fprintln(e.output, "  FROM '{}'  -- no snippet stored;")
}

It doesn't show the Folder. This could be an issue for roundtrip if Folder is set.

Similarly, in the CREATE function:

if s.Folder != "" {
    folderID, err := e.resolveFolder(module.ID, s.Folder)
    if err != nil {
        return fmt.Errorf("failed to resolve folder %s: %w", s.Folder, err)
    }
    containerID = folderID
}

So Folder is handled in CREATE but not shown in DESCRIBE. This would break the roundtrip.

This is a moderate issue that should be fixed.

Also, let me check the ImportMapping and ExportMapping DESCRIBE functions for similar issues.

For ImportMapping DESCRIBE:

fmt.Fprintf(e.output, "CREATE IMPORT MAPPING %s.%s\n", moduleName, im.Name)
if im.JsonStructure != "" {
    fmt.Fprintf(e.output, "  FROM JSON STRUCTURE %s\n", im.JsonStructure)
} else if im.XmlSchema != "" {
    fmt.Fprintf(e.output, "  FROM XML SCHEMA %s\n", im.XmlSchema)
}

This looks complete - it shows the FROM clause.

For ExportMapping DESCRIBE:

fmt.Fprintf(e.output, "CREATE EXPORT MAPPING %s.%s\n", moduleName, em.Name)
if em.JsonStructure != "" {
    fmt.Fprintf(e.output, "  TO JSON STRUCTURE %s\n", em.JsonStructure)
} else if em.XmlSchema != "" {
    fmt.Fprintf(e.output, "  TO XML SCHEMA %s\n", em.XmlSchema)
}

if em.NullValueOption != "" && em.NullValueOption != "LeaveOutElement" {
    fmt.Fprintf(e.output, "  NULL VALUES %s\n", em.NullValueOption)
}

This also looks complete.

So the JSON Structure DESCRIBE is missing the Folder output.

Let me also check if there are any other potential issues:

In the skill document, it shows:

CREATE JSON STRUCTURE Module.JSON_MyStructure
  FROM '{"key": "value", "count": 1}';

But it doesn't show the FOLDER clause in the example, though it's mentioned in the text.

The AST definition includes Folder, so the DESCRIBE should output it if present.

This is a moderate issue affecting roundtrip completeness.

Another potential issue: In the REST CALL microflow generation, the skill shows:

$Result = REST CALL GET '{1}' WITH ({1} = $endpoint)
  HEADER 'Accept' = 'application/json'
  TIMEOUT 300
  RETURNS MAPPING Module.IMM_MyMapping AS Module.MyRootObject ON ERROR ROLLBACK;

But I don't see where the "WITH ({1} = $endpoint)" part is handled in the executor. Looking at cmd_microflows_builder_calls.go, I see it handles the REST CALL but need to check if it processes the WITH clause for parameters.

Actually, looking more carefully at the diff in cmd_microflows_builder_calls.go:

func (fb *flowBuilder) addRestCallAction(s *ast.RestCallStmt) model.ID {
    // ...
    case ast.RestResultMapping:
        // ...

This suggests the RestCallStmt has fields for Method, Url, etc., and the WITH clause would be part of the Url or parameters handling.

Without seeing the full RestCallStmt definition, it's hard to say, but this is potentially an area to check.

However, since the skill document shows it working, and the PR includes tests, it's likely implemented correctly.

Let me also check for any syntax violations in the MDL examples:

In the skill document:

CREATE IMPORT MAPPING Module.IMM_MyMapping
  FROM JSON STRUCTURE Module.JSON_MyStructure
{
  "" -> Module.MyRootObject (Create) {
    nestedKey -> Module.MyNestedObject (Create) VIA Module.MyRootObject_MyNestedObject {
      name -> name (String)
      code -> code (String)
    }
    stringField -> stringField (String)
    intField    -> intField    (Integer)
  }
};

This looks correct:

  • Property format uses colon: (Create)
  • AS is used correctly in the skill document text but not in the MDL examples (which is correct - AS is for mappings like nestedKey -> Module.MyNestedObject)
  • Uses qualified names everywhere
  • Reads as English

Actually, wait - in the mapping:

nestedKey -> Module.MyNestedObject (Create) VIA Module.MyRootObject_MyNestedObject {

Here, nestedKey is the JSON key, -> is the mapping operator, Module.MyNestedObject is the entity, (Create) is the handling, VIA Module.MyRootObject_MyNestedObject is the association path.

This follows the pattern: jsonKey -> Entity (Handling) VIA Association

The skill document explains this well.

One more thing to check: In the ImportMappingElementDef in AST:

type ImportMappingElementDef struct {
    // JSON field name (or "root" for the root element)
    JsonName string
    // Object mapping fields (set when mapping to an entity)
    Entity         string // qualified entity name (e.g. "Module.Customer")
    ObjectHandling string // "Create", "Find", "FindOrCreate", "Custom"
    Association    string // qualified association name for via clause
    Children       []*ImportMappingElementDef
    // Value mapping fields (set when mapping to an attribute)
    Attribute string // attribute name (unqualified, e.g. "Name")
    DataType  string // "String", "Integer", "Boolean", "Decimal", "DateTime"
    IsKey     bool
}

And in the printing function:

func printImportMappingElement(e *Executor, elem *model.ImportMappingElement, depth int) {
    indent := strings.Repeat("  ", depth)
    if elem.Kind == "Object" {
        // ...
        jsonKey := elem.ExposedName
        if jsonKey == "" {
            jsonKey = `""`
        }
        if len(elem.Children) > 0 {
            fmt.Fprintf(e.output, "%s%s -> %s (%s)%s {\n", indent, jsonKey, entityOrName, handling, via)
            // ...
        } else {
            fmt.Fprintf(e.output, "%s%s -> %s (%s)%s", indent, jsonKey, entityOrName, handling, via)
        }
    } else {
        // Value mapping
        // ...
        fmt.Fprintf(e.output, "%s%s -> %s (%s%s)", indent, elem.ExposedName, attrName, dt, keyStr)
    }
}

This looks correct for generating MDL like:

"" -> Module.MyRootObject (Create) {
  nestedKey -> Module.MyNestedObject (Create) VIA Module.MyRootObject_MyNestedObject {
    name -> name (String)
    code -> code (String)
  }
  stringField -> stringField (String)
  intField    -> intField    (Integer)
}

The root element uses "" as shown in the skill.

Now, back to the Folder issue in JSON Structure DESCRIBE - that's a clear moderate issue.

Let me also check check


Automated review via OpenRouter (Nemotron Super 120B) — workflow source

Copy link
Copy Markdown
Collaborator

@ako ako left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

Scope

This is a large PR (19K additions, 85 files) that bundles 6 independent features:

  1. JSON Structure (SHOW/DESCRIBE/CREATE/DROP)
  2. Import Mapping (SHOW/DESCRIBE/CREATE/DROP)
  3. Export Mapping (SHOW/DESCRIBE/CREATE/DROP)
  4. SEND REST REQUEST enhancements (auto-derive output variable, single/list detection)
  5. Lint rule mpr008_overlapping_activities
  6. go fmt across ~50 files

Per the repo's checklist, these should be separate PRs. At minimum: (a) JSON Structure, (b) Import/Export Mapping, (c) SEND REST REQUEST improvements, (d) lint rule, (e) formatting.


Overlap with PR #80

PR #80 (by @peterjumpnl) and this PR both implement JSON Structure SHOW/DESCRIBE/CREATE/DROP independently. Here's a detailed comparison:

Syntax

Feature PR #80 (peterjumpnl) PR #84 (khode-mx)
CREATE syntax CREATE JSON STRUCTURE M.N SNIPPET '...' CREATE JSON STRUCTURE M.N FROM '...'
Dollar quoting SNIPPET $$...$$ ❌ Only STRING_LITERAL
OR REPLACE CREATE OR REPLACE ❌ Not supported
Documentation COMMENT 'doc' ❌ Not supported
Custom name map CUSTOM NAME MAP ('key' AS 'Name') ❌ Not supported
FOLDER support FOLDER 'path'
DESCRIBE output Re-executable CREATE OR REPLACE ... SNIPPET CREATE ... FROM '...' (not idempotent)

Implementation quality

Aspect PR #80 PR #84
JSON key ordering ✅ Preserves original key order via streaming json.Decoder ❌ Uses map[string]anysort.Strings(keys) (alphabetical, loses original order)
Reserved names ✅ Handles Id/Type_id/_type ❌ Not handled
Primitive arrays ✅ Wrapper element with Value child (matches Studio Pro) ❌ Not handled
DateTime detection ✅ Regex-based, normalizes to 7-digit fractional time.Parse + reformat to local TZ
DateTime normalization String manipulation (deterministic) time.Parse + time.Local (non-deterministic — output depends on server timezone)
null handling "Unknown" primitive type (matches Studio Pro) "String" primitive type (doesn't match Studio Pro)
Catalog integration json_structures table ❌ Not included
REPL autocomplete ❌ Not included
Tests No Go tests (golden files only) ✅ 6 test files, 45 tests including mx check
BSON serialization Uses bson.D (ordered) Uses bson.M (unordered — BSON field order not guaranteed)

Verdict on JSON Structure: PR #80 has better syntax design (SNIPPET keyword, dollar quoting, OR REPLACE, custom name map), better Studio Pro fidelity (key ordering, reserved names, primitive arrays, null handling), and better pipeline coverage (catalog, autocomplete). PR #84 has better test coverage and FOLDER support. Recommend merging PR #80's JSON Structure and adding PR #84's tests and FOLDER support on top.

Critical issue in PR #84's JSON Structure: bson.M vs bson.D

PR #84 serializes with bson.M (unordered map):

doc := bson.M{
    "$ID":           ...,
    "$Type":         "JsonStructures$JsonStructure",
    "Name":          js.Name,
    ...
}

PR #80 uses bson.D (ordered document):

doc := bson.D{
    {Key: "$ID", Value: ...},
    {Key: "$Type", Value: "JsonStructures$JsonStructure"},
    ...
}

bson.M produces non-deterministic field ordering in the serialized BSON. While Mendix may tolerate this for some document types, it risks issues with strict parsers and makes roundtrip testing unreliable.


Overlap with existing SEND REST REQUEST

The SEND REST REQUEST microflow action already exists in the codebase. PR #84 enhances it with:

  • Auto-deriving the output variable name from the entity name
  • Auto-detecting single vs list result by inspecting the JSON structure's root element type

These are useful improvements. However, the auto-derive logic overwrites s.OutputVariable unconditionally:

s.OutputVariable = s.Result.ResultEntity.Name

This means any explicitly set output variable in MDL would be silently overwritten. Should only set if s.OutputVariable == "".


Import/Export Mapping syntax

The mapping syntax uses -> arrows, which conflicts with the MDL design principle of "no symbols for domain operations":

root -> Module.Entity (Create) {
    id -> Id (Integer, KEY);
    name -> Name (String);
};

Per .claude/skills/design-mdl-syntax.md, MDL should use keyword-based constructs. Consider:

MAP root TO Module.Entity (Create) {
    MAP id TO Id (Integer, KEY);
};

That said, the arrow syntax is arguably readable and maps clearly to the mental model. Worth discussing.


Other issues

  1. go fmt across 50 files — formatting changes are bundled with feature work, making the diff hard to review. Should be a separate commit/PR.

  2. Lint rule mpr008_overlapping_activities — independent feature, should be its own PR.

  3. Model types in model/types.go — both PRs define JsonStructure and JsonElement types but in different locations (PR #80 in sdk/mpr/reader_types.go, PR #84 in model/types.go). PR #84's approach of putting them in model/ is architecturally cleaner since they're used across packages.

  4. Test plan has all boxes unchecked — none of the 9 verification items are checked.

Recommendation

  1. Split this PR into at least 4 PRs: JSON Structure, Import/Export Mapping, SEND REST REQUEST improvements, lint rule + formatting
  2. For JSON Structure: coordinate with PR #80 to avoid duplicate work. PR #80 has better syntax and Studio Pro fidelity; PR #84 has better tests. Merge PR #80 first, then add tests and FOLDER support on top.
  3. Fix bson.Mbson.D for deterministic serialization
  4. Fix the output variable overwrite in SEND REST REQUEST
  5. Discuss arrow syntax vs keyword syntax for mappings

@github-actions github-actions bot mentioned this pull request Apr 3, 2026
ako added a commit that referenced this pull request Apr 3, 2026
Clean rework of PR #84 (call-rest branch): drops duplicate JSON Structure
code already on main, removes formatting noise (~30 files), and changes
mapping syntax from -> to AS for consistency with existing database
client mappings and design guidelines.

New features:
- CREATE/DROP/SHOW/DESCRIBE IMPORT MAPPING with AS syntax
- CREATE/DROP/SHOW/DESCRIBE EXPORT MAPPING with AS syntax
- SEND REST REQUEST microflow activity
- Lint rule mpr008_overlapping_activities
- Import/export mapping examples in REST client doctype tests
- Skill doc for end-to-end REST call from JSON workflow

Co-Authored-By: Dennis Kho <dennis.kho@mendix.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions bot mentioned this pull request Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants