{"added":{"user.email":"[email protected]"},"removed":{},"changed":{"user.age":{"from":30,"to":31}}}
curl --location --request POST 'https://zylalabs.com/api/13165/data+structure+tools+api/26711/compare+two+documents' --header 'Authorization: Bearer YOUR_API_KEY'
--data-raw '{"a": {"user": {"age": 30}}, "b": {"user": {"age": 31, "email": "[email protected]"}}}'
注册后,每个开发者都会被分配一个个人 API 访问密钥,这是一个唯一的字母和数字组合,用于访问我们的 API 端点。要使用 数据结构工具 API 进行身份验证,只需在 Authorization 标头中包含您的 bearer token。
| 标头 | 描述 |
|---|---|
授权
|
必需
应为 Bearer access_key. 订阅后,请查看上方的"您的 API 访问密钥"。
|
无长期承诺。随时升级、降级或取消。 免费试用包括最多 50 个请求。
(年度计费可节省 2 个月 🎉)
领先企业的信赖之选
一个完整的工具箱,用于通过单个键管理结构化数据文档。格式化和验证,扁平化深度嵌套文档为点表示法键并重建它们,逐字段比较两个文档,并将记录数组转换为适合电子表格的逗号分隔文本,反之亦然。
有助于检测环境之间的配置漂移,将数据交给电子表格用户,为数据库列扁平化文档,以及在交付管道中清理数据
The Compare Two Documents endpoint returns a structured JSON object that highlights differences between two documents. It categorizes changes into "added," "removed," and "changed," providing the dot notation path for each field along with old and new values for any changes.
The key fields in the response data include "added," "removed," and "changed." Each of these fields contains nested objects that represent the differences between the two documents, with paths indicating the location of each change.
The response data is organized into three main sections: "added" for new fields, "removed" for fields that no longer exist, and "changed" for fields that have been modified. Each section uses dot notation to specify the path to the affected fields.
The Compare Two Documents endpoint provides information on structural changes between two documents, including which fields were added, removed, or changed, along with their respective values before and after the change.
Users can customize their data requests by providing two structured documents in the request body. The API will then compare these documents based on their structure and content, returning a detailed comparison.
Typical use cases include detecting configuration drift between environments, validating data integrity during migrations, and ensuring consistency in structured data across different applications or systems.
数据准确性通过内存处理得以维护,这确保了文档直接进行比较而无需存储,从而最小化在比较过程中数据损坏或丢失的风险
如果文件之间没有差异,响应将指示“添加”、“删除”和“更改”字段为空 用户可以检查这些字段来确定文件是否相同或是否需要处理特定更改