@RequestMapping(value = "/pokemon/{name}", produces = "application/json", method = RequestMethod.GET) @ResponseStatus(HttpStatus.OK) public Pokemon getPokemon(@PathVariable(value = "name") String name) { Pokemon result = pokemonRepository.findByName(name); if (result == null) { throw new PokemonNotFoundException(name); } return result; }