We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
对您想要需求或建议的清晰简洁的描述。 接收的数据是{ "data_list":"1" } 返回的是{ "dataList": "1" } 没有全局设置 要每个字段都要写 @JSONField(name = "data_list") 很累欸
The text was updated successfully, but these errors were encountered:
import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.PropertyNamingStrategy; import com.alibaba.fastjson2.filter.NameFilter; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; public class Issue3344 { @Test public void test() { Bean bean = new Bean(); bean.userName = "DataWorks"; String jsonString = JSON.toJSONString(bean, NameFilter.of(PropertyNamingStrategy.SnakeCase)); assertEquals("{\"user_name\":\"DataWorks\"}", jsonString); } public static class Bean { public String userName; } }
看这个是不是你想要的
Sorry, something went wrong.
add testcase for issue #3344
9a1141b
谢谢, config.setWriterFilters(NameFilter.of(PropertyNamingStrategy.SnakeCase));在这里成功了
No branches or pull requests
请描述您的需求或者改进建议
对您想要需求或建议的清晰简洁的描述。
接收的数据是{
"data_list":"1"
}
返回的是{
"dataList": "1"
}
没有全局设置 要每个字段都要写 @JSONField(name = "data_list") 很累欸
The text was updated successfully, but these errors were encountered: