alibaba / alibaba/fastjson2

增加JSONDiff功能

Open
#869 4 comments 3 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
4.4k
Forks
613
Avg merge
1d 22h
Merged PRs (30d)
6

Description

### 请描述您的需求或者改进建议
*对您想要需求或建议的清晰简洁的描述。*
增加json diff比对功能,获取变更 [add,del,modify]类型的list。以jsonpath作为寻址标记。
```
diffRes=JSON.diff(JSON1,JSON2);
Tuple addRes=diffRes.add();
Tuple=diffRes.del();
Tuple=diffRes.modify();
```
### 请描述你建议的实现方案
*对您想要需求或建议的实现方案的详细描述。*
遍历对比两个json

### 描述您考虑过的替代方案
*对您考虑过的任何替代解决方案或功能的描述。*

#### 附加信息
*如果你还有其他需要提供的信息,可以在这里填写(可以提供截图、视频等)。*

Contributor guide

Open the contributing guide

Research direction

No source file or test is named. Start by locating the JSON API entry points and existing JSONPath support, then trace how two JSON values could be compared; done means an API exposes add, delete, and modify results with the requested JSONPath and old/new value shapes.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.