Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

Your JSON is valid and your invoice is wrong

说明与用途

在重构 JSON 负载时,模板绑定可能过时,导致发票缺失或错误的客户信息。通过显式映射新字段到模板占位符并验证合同,可防止静默失败。

问题

A refactor changes the JSON payload shape, but the template binding remains unchanged, causing invoices to be generated without a customer name or with the wrong name.

结果

By explicitly mapping new JSON fields to template placeholders and validating against a defined contract, invoices are prevented from being generated with missing or incorrect customer data.

工作流

  • 1. Refactor backend to use new JSON shape.
  • 2. Detect schema mismatch between incoming data and template contract.
  • 3. Create a mapping proposal (e.g., customer.legalName → client.name).
  • 4. Validate mapping with synthetic test cases covering normal, missing, and conflicting data.
  • 5. Review and approve mapping, saving it with a mappingId tied to the template revision.
  • 6. Render invoice using the approved mapping, receiving a 422 SCHEMA_DRIFT error if mismatched.
  • 7. Verify rendered PDF contains correct customer information.

证据

Both are valid JSON. Both contain the same company name.

来源

If the integration quietly converts a missing value into an empty string, the PDF may still render.

来源

A structural validator can check that a string exists at a declared path. It cannot infer which business entity you intended to bill just because two field names look related.

来源

In Bitavu, a detected schema mismatch is reported as 422 SCHEMA_DRIFT.

来源

  • 记录日期: 2026-11-03T20:13:50.903Z