Skip to content
New issue

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

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

Already on GitHub? # to your account

接口参数如果Map的key 是NULL会被替换成0 #30

Open
iwhalecloud-platform opened this issue Apr 16, 2020 · 0 comments
Open

接口参数如果Map的key 是NULL会被替换成0 #30

iwhalecloud-platform opened this issue Apr 16, 2020 · 0 comments

Comments

@iwhalecloud-platform
Copy link

public class User implements java.io.Serializable {

    private Map<Long, Long> map;

    public Map<Long, Long> getMap() {
        return map;
    }

    public void setMap(Map<Long, Long> map) {
        this.map = map;
    }
}

序列化之前:

User user = new User();
                Map<Long, Long> map = new HashMap<>();
                map.put(null, 1L);
                user.setMap(map);
                String hello = demoService.sayHello(user);

序列化之后,map里面的key变成0

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant