metodo en spring boot para que me saque todos los tacos que hay en una lista mediante su id
@GetMapping("tacos/{id}") public ResponseEntity<Taco> getTacoById(@PathVariable("id") long id) { Optional<Taco> tacoData = repository.findById(id); if (tacoData.isPresent()) { return new ResponseEntity<>(tacoData.get(), HttpStatus.OK); } else { return new ResponseEntity<>(HttpStatus.NOT_FOUND); } }