avatar
convert java array to Json array Java
List<User> users = userRepository.findAll();
ObjectMapper mapper = new ObjectMapper();
try {
    String json = mapper.writeValueAsString(users);
    System.out.println(json);
} catch (JsonProcessingException e) {
    e.printStackTrace();
}
You need to login to do this manipulation!