Skip to content

docs: add JSON mapping design doc - #9748

Open
praveensri wants to merge 1 commit into
mainfrom
docs/json-liquid-btm-coverage
Open

praveensri wants to merge 1 commit into
mainfrom
docs/json-liquid-btm-coverage

Conversation

@praveensri

Copy link
Copy Markdown
Collaborator

Commit Type

  • feature - New functionality
  • fix - Bug fix
  • refactor - Code restructuring without behavior change
  • perf - Performance improvement
  • docs - Documentation update
  • test - Test-related changes
  • chore - Maintenance/tooling

Risk Level

  • Low - Minor changes, limited scope
  • Medium - Moderate changes, some user impact
  • High - Major changes, significant user/system impact

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

  • Users: No runtime behavior changes; this documents the proposed JSON mapping experience.
  • Developers: Design reference for future JSON Schema-based mapping and Liquid output work.
  • System: Documentation only; no code or dependencies changed.

Test Plan

  • Unit tests added/updated
  • E2E tests added/updated
  • Manual testing completed
  • Tested in:
    Documentation-only change. No automated tests run; Markdown table column consistency was checked.

Contributors

@psrivas_microsoft

Screenshots/Videos

Not applicable; documentation-only change.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 95a99562-74ed-471a-8764-c9eee5224339
Copilot AI balanced review requested due to automatic review settings November 26, 2026 12:03
@praveensri praveensri added the risk:low Low risk change with minimal impact label Nov 26, 2026
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

🤖 AI PR Validation Report

PR Review Results

Thank you for your submission! Here's detailed feedback on your PR title and body compliance:

✅ PR Title

  • Current: docs: add JSON mapping design doc
  • Issue: None. The title clearly identifies this as documentation and describes the design document being added.
  • Recommendation: No changes required.

✅ Commit Type

  • Properly selected (docs).
  • Only one commit type is selected, and it matches the documentation-only change.

✅ Risk Level

  • The PR selects Low risk and has the matching risk:low label.
  • The code diff adds only a Markdown design document, with no runtime, dependency, or production code changes. The advised risk level is low, matching the submitter's estimate.

✅ What & Why

  • Current: The PR explains that it documents the JSON-to-JSON mapper design, including JSON Schema handling, Liquid generation, the designer surface, functoid coverage, and implementation work.
  • Issue: None. The section provides sufficient context and rationale for the documentation change.
  • Recommendation: No changes required.

✅ Impact of Change

  • The impact section appropriately identifies that there are no runtime changes and describes the documentation impact for users, developers, and the system.
  • Recommendation:
    • Users: No runtime or user-facing behavior changes; the document describes a proposed JSON mapping experience.
    • Developers: Provides a design reference for future JSON Schema, BTM, Liquid, designer, and worker implementation work.
    • System: Documentation-only change; no dependencies, architecture, or deployed behavior are modified.

✅ Test Plan

  • The test plan passes because the diff contains documentation only and therefore does not require unit or E2E tests.
  • The body also clearly explains that no automated tests were run and that Markdown table consistency was checked manually.

✅ Contributors

  • A contributor, @psrivas_microsoft, is credited.
  • No changes required. Additional PM, design, or reviewer credits may be added if applicable, but this is optional.

✅ Screenshots/Videos

  • Correctly marked as not applicable because this is a documentation-only change.

Summary Table

Section Status Recommendation
Title ✅ No changes required
Commit Type ✅ docs is correctly selected
Risk Level ✅ Low risk and risk:low label match the documentation-only diff
What & Why ✅ Sufficient explanation provided
Impact of Change ✅ Users, developers, and system impact are addressed
Test Plan ✅ Documentation-only change with an adequate testing explanation
Contributors ✅ Contributor credit is present
Screenshots/Videos ✅ Correctly marked not applicable

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

@github-actions

Copy link
Copy Markdown
Contributor

📊 Coverage Check

No source files changed in this PR.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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
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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-validated risk:low Low risk change with minimal impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants