Skip to content

[Feature] 关于其他 JSON 框架的支持 #798

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
lanyuanxiaoyao opened this issue Mar 3, 2025 · 2 comments
Open

[Feature] 关于其他 JSON 框架的支持 #798

lanyuanxiaoyao opened this issue Mar 3, 2025 · 2 comments
Labels
Enhancement 增强 增强功能、提高性能等

Comments

@lanyuanxiaoyao
Copy link

Description

目前看到最新的依赖和文档里仍是 Fastjson,看到之前的 issue 有提到后面支持其他 JSON 框架的扩展,不知道现在进度怎么样了,目前整合项目的时候使用的是 Jackson,其中有一些自定义的调优配置,希望能统一 JSON 框架,方便升版修复漏洞等等

@TommyLemon
Copy link
Collaborator

TommyLemon commented Mar 5, 2025

需要把 APIJSON, apijson-framework 所有用到 fastjson 的 JSONObject, JSONArray 的地方替换成 Map<String, Object> 和 List<Object>

@TommyLemon TommyLemon added the Enhancement 增强 增强功能、提高性能等 label Mar 9, 2025
@TommyLemon
Copy link
Collaborator

TommyLemon commented Apr 11, 2025

@lanyuanxiaoyao APIJSON 8 已经去掉 fastjson
6712e96
APIJSON/apijson-framework@df9ca57

3 个 Demo 已使用 APIJSON 8
https://github.com/APIJSON/APIJSON-Demo/commits/master/APIJSON-Java-Server
Image

当然这个也导致初始化麻烦一些,需要重写 parseObject, parseArray 等方法,用具体的 JSON 库来反序列化,
打算后续提供 apijson-fastjson2, apijson-jackson, apijson-gson 等对应插件,引入后可以简化这部分代码:
https://github.com/APIJSON/APIJSON-Demo/blob/eb051b0df273f30479b10d1238d666e4ed2efadd/APIJSON-Java-Server/APIJSONDemo/src/main/java/apijson/demo/DemoApplication.java#L81-L127

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement 增强 增强功能、提高性能等
Projects
None yet
Development

No branches or pull requests

2 participants