Skip to content
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

[QUESTION]fastjson2 解析Gson的@SerializedName 有开关关闭吗 #2346

Closed
JadeSpring opened this issue Mar 20, 2024 · 4 comments
Closed
Labels
fixed question Further information is requested
Milestone

Comments

@JadeSpring
Copy link

项目中有使用Gson的@SerializedName 注解的字段,在使用fastjson转json时不希望使用@SerializedName 注解的字段名

@JadeSpring JadeSpring added the question Further information is requested label Mar 20, 2024
@wenshao wenshao added this to the 2.0.48 milestone Mar 21, 2024
@wenshao
Copy link
Member

wenshao commented Mar 21, 2024

https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.48-SNAPSHOT/

请帮忙用2.0.48-SNAPSHOT验证,2.0.48正式版本预计在月末发布

在2.0.48-SNAPSHOT中,可以通过JVM启动参数关闭Gson Annoation的解析,比如:

-Dfastjson2.useGsonAnnotation=false

又或者在classpath中加上fastjson2.properties文件,并在文件里加上如下内容:

fastjson2.useGsonAnnotation=false

@wenshao wenshao added the fixed label Mar 21, 2024
@JadeSpring
Copy link
Author

我这边是使用

com.alibaba
fastjson
2.0.45

兼容版本有吗

@wenshao
Copy link
Member

wenshao commented Mar 25, 2024

@wenshao wenshao closed this as completed Mar 25, 2024
@wenshao
Copy link
Member

wenshao commented Mar 25, 2024

com.alibaba
fastjson
2.0.48
也可以用这个版本

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants