Мое приложение возвращает «[{}, {}]», когда я запрашиваю asList. Но когда я запрашиваю строку, она отображается нормально в браузере.
Изображения: 1. IDE EndPoint 2. Возврат браузера
Конечная точка
package br.com.devdojo.app.endpoint;
import br.com.devdojo.app.model.Student;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import static java.util.Arrays.asList;
@RestController
@RequestMapping("student")
public class StudentEndPoint {
@RequestMapping(method = RequestMethod.GET, path = ("/list"))
public List<Student> listAll(){
return asList(new Student("Aluno1"), new Student("Aluno2"));
}
}