-
Notifications
You must be signed in to change notification settings - Fork 26
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
字段名字能否做到驼峰和下划线的映射 #9
Comments
可以提供一些案例参考吗,避免开发后有些兼容问题 |
场景基本如下: |
|
yes!!! |
这种不应该是通过配置jackson 来解决问题吗? String json = "{\"user_name\":\"wang\"}";
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.setPropertyNamingStrategy(PropertyNamingStrategies.SnakeCaseStrategy.INSTANCE);
U u = objectMapper.readValue(json, U.class);
System.out.println(u.getUserName());
public static class U{
private String userName; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
前端传入的vo都是下划线规则的属性,但是dto是驼峰规则的属性,现在转起来麻烦些,可否做到自动识别。
The text was updated successfully, but these errors were encountered: