Repository navigation
docs: add JSON mapping design doc - #9748
Open
praveensri wants to merge 1 commit into
Open
praveensri wants to merge 1 commit into
praveensri wants to merge 1 commit into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 95a99562-74ed-471a-8764-c9eee5224339
Contributor
🤖 AI PR Validation ReportPR Review ResultsThank you for your submission! Here's detailed feedback on your PR title and body compliance:✅ PR Title
✅ Commit Type
✅ Risk Level
✅ What & Why
✅ Impact of Change
✅ Test Plan
✅ Contributors
✅ Screenshots/Videos
Summary Table
The PR title and body pass review. No updates are required.Powered by: Logic App (fallback) | Last updated: Thu, 26 Nov 2026 12:04:08 GMT |
Contributor
📊 Coverage CheckNo source files changed in this PR. |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved mapping-parity errors, unsafe constant folding, and ambiguous path encoding could change runtime results or cause distinct nodes to share a persisted identity.
7 open issues
Escape backslashes to prevent duplicate node link identities · New Exclude nondeterministic Date/Time functoids from constant folding · New Preserve Division’s empty result for zero divisors · New Preserve LogicalCompare numeric parsing and string fallback semantics · New Align IsNumeric parsing with scientific-notation behavior · New Preserve Join’s separator-free output · New Use key membership, not non-null checks, for property presence · New
What changed in this PR
Adds a draft design for JSON-to-JSON mapping in the BTM-based Data Mapper v3, reusing the existing editor while generating Liquid templates for Logic Apps. This PR changes documentation only; it adds no runtime functionality or dependencies.
Changes:
- Defines JSON Schema loading, BTM persistence, and an intermediate representation for direct Liquid generation.
- Maps existing functoids and proposed extensions to DotLiquid capabilities, including reverse coverage and test-suite cross-checks.
- Describes designer updates, Test Map, deployment, security constraints, and phased implementation and testing.
| File | Description |
|---|---|
libs/data-mapper-v3/docs/json-mapping-design.md |
Documents the proposed JSON mapping architecture, capability matrices, user experience, and delivery plan. |
Review effort: Balanced
Comment on lines
+203
to
+205
| - Link paths use the existing BTM path syntax over JSON property names, for | ||
| example `/Order/items/sku`. In names, `/`, `[` and `]` are escaped as `\/`, | ||
| `\[` and `\]`. |
Comment on lines
+278
to
+282
| Before this check, `MapIrBuilder` **constant-folds** every functoid whose | ||
| inputs are all constants, evaluating it in TypeScript with XSLT-path | ||
| semantics. The result is emitted as a literal, so even an unsupported | ||
| functoid (for example `Sqrt(2)`) compiles when all of its inputs are | ||
| constants. |
| | 118 | Addition (2–100) | `+` | ✅ | `a \| Plus: b \| Plus: c …` | | ||
| | 119 | Subtraction | `-` | ✅ | `a \| Minus: b` | | ||
| | 120 | Multiplication (2–100) | `*` | ✅ | `a \| Times: b …` | | ||
| | 121 | Division | `div` | ✅ | `a \| DividedBy: b`. Normalized operands make it decimal division. A normalized zero divisor renders `∞`, which is invalid JSON (an integer zero throws), so the emitter guards with `{% if b != 0 %}` and emits `null` otherwise. XPath would give `Infinity`. | |
Comment on lines
+436
to
+437
| | 311–314 | `>`, `>=`, `<`, `<=` | XPath numeric comparison | ✅ | `{% if a > b %}` with normalized operands (§7.4.1 #7). | | ||
| | 315, 316 | `=`, `!=` | XPath `=` / `!=` | ✅ | `==` / `!=`. Operands are normalized when either side is numeric, and compared as strings otherwise. | |
| | 315, 316 | `=`, `!=` | XPath `=` / `!=` | ✅ | `==` / `!=`. Operands are normalized when either side is numeric, and compared as strings otherwise. | | ||
| | 317 | IsString | `string(x) != ''` | ✅ | `x != nil and x != ""` | | ||
| | 318 | IsDate | `DateTime.TryParse` | 🟡 | `{% assign f = x \| Date: "yyyyMMddHHmmssfff" %}{% if x != nil and x != "" and f != x %}`. Invalid dates are returned unchanged (§7.4.1 #11). | | ||
| | 319 | IsNumeric | `number(x) = number(x)` | 🟡 | `{% assign n = x \| Round: 15 %}{% if x != nil and x != "" and n != nil %}`. Like XPath 1.0, `"1e3"` is not numeric. | |
| | 324 | Cumulative Sum | 🟡 | `{% assign t = 0 %}{% for x in arr %}{% assign v = x.q \| Round: 15 %}{% assign t = t \| Plus: v %}{% endfor %}` | | ||
| | 325 | Cumulative Average | 🟡 | The sum as in 324, then `t \| DividedBy: arr.size`, guarded when the array is empty. | | ||
| | 326, 327 | Cumulative Minimum, Maximum | 🟡 | An accumulator starting at `nil`: `{% if m == nil or v < m %}{% assign m = v %}{% endif %}` | | ||
| | 328 | Cumulative Concatenate | ✅ | `arr \| Map: "q" \| Join: sep` for a direct child property. Deeper paths use `capture` in a `for` (🟡). | |
| | `and`, `or` | BTM ✅ | 320, 321 (hoisted, §7.3) | | ||
| | `contains` (string or array) | New 🆕 | 9120 Contains. Composition with 101 Find > 0 also works, but only for strings. | | ||
| | `startsWith`, `endsWith` | New 🆕 | 9121 Starts With, 9122 Ends With | | ||
| | `hasKey` | BTM ✅ | 701 Logical Existence | |
This branch has not been deployed
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.

Commit Type
Risk Level
What & Why
Documents the JSON-to-JSON data mapper design, including direct Liquid generation, designer surface, and a reverse-coverage matrix mapping DotLiquid 2.0.361 filters, tags, and operators to BTM functoids, compositions, or explicit exclusions. Adds a cross-check against the DotLiquid test suite and identifies proposed extension FIDs and implementation work.
Impact of Change
Test Plan
Documentation-only change. No automated tests run; Markdown table column consistency was checked.
Contributors
@psrivas_microsoft
Screenshots/Videos
Not applicable; documentation-only change.