fix: resolve JSON structure qualified-name lookup through folder hierarchy#508
Merged
ako merged 2 commits intomendixlabs:mainfrom May 4, 2026
Merged
Conversation
…archy GetJsonStructureByQualifiedName matched the stored ContainerID directly against the module ID, so JSON structures nested in module subfolders (e.g. Module/Subfolder/MyJson) were reported as "not found". This failure silently degraded REST-call roundtrip fidelity: addRestCallAction uses the JSON structure's root element type to decide whether the import mapping returns a single Object or a List, so a missing lookup defaulted to `SingleObject=false` and produced List-typed output when the authored mapping was Object-typed. Downstream activities using the output variable then failed mx check with CE0019/CE0097/CE0136/CE0243. Use buildContainerModuleNameMap (the same helper that GetImportMappingByQualifiedName already uses) to resolve container IDs through the folder hierarchy up to the owning module, then match on module name. No schema change; lookup behaviour only. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Reader+synthetic MPR test with a JSON structure placed inside a module subfolder. Exercises GetJsonStructureByQualifiedName through the folder → module resolution path and also pins the negative case (cross-module lookup still returns an error). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
AI Code ReviewCritical Issues(None found) Moderate Issues(None found) Minor Issues(None found) What Looks Good
RecommendationApprove - The PR is ready for merging. It fixes a significant roundtrip fidelity bug with minimal, well-tested changes that align with existing code patterns. No further action is needed. Automated review via OpenRouter (Nemotron Super 120B) — workflow source |
Collaborator
Review: fix/resolve-json-structure-qualified-name-lookupResult: Approved — no blockers. What the PR doesFixes in to resolve the module name through the full folder hierarchy (using ) instead of doing a direct comparison, which failed for structures nested inside folders. Checklist
NotesThe structure of the fix is clean and the test is appropriately targeted. No concerns. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GetJsonStructureByQualifiedNamematched the storedContainerIDdirectly against the module ID, so JSON structures nested in module subfolders (e.g.Module/Subfolder/MyJson) were reported as "not found".addRestCallActionuses the JSON structure's root element type to decide whether the import mapping returns a single Object (SingleObject=true) or a List (SingleObject=false). A failed lookup defaulted toSingleObject=false, so any REST call whose import mapping referenced a folder-nested JSON structure produced List-typed output when the authored mapping was Object-typed.mx checkwith cascading diagnostics —CE0019(variable as start point must be Object),CE0097(list operation needs a List),CE0136(retrieve missing Entity),CE0243(mapping type mismatch) — all rooted in the single misclassifiedSingleObjectflag.Fix
Use
buildContainerModuleNameMap— the same helperGetImportMappingByQualifiedNamealready uses — to resolve container IDs through the folder hierarchy up to the owning module, then match on module name.No schema change; lookup behaviour only. Mirrors existing
GetImportMappingByQualifiedName/GetExportMappingByQualifiedNamepatterns.Test plan
TestGetJsonStructureByQualifiedName_ResolvesThroughFolders— synthetic MPR with a JSON structure placed inside a module subfolder; lookup by module name must find it.go test ./...passes.returns mapping M.IMM_X as M.EntitywhereM.JSON_Xis nested underM/Folder/now producesRange.SingleObject=True+VariableType=ObjectTypematching the authored BSON.🤖 Generated with Claude Code