diff --git a/src/main/java/org/springframework/samples/petclinic/rest/PetRestController.java b/src/main/java/org/springframework/samples/petclinic/rest/PetRestController.java index 6759cdcf050754ebd187c798eda495ca5fa82435..24cafa9578a5341317da20f391981e2871c2c1ed 100644 --- a/src/main/java/org/springframework/samples/petclinic/rest/PetRestController.java +++ b/src/main/java/org/springframework/samples/petclinic/rest/PetRestController.java @@ -51,7 +51,7 @@ public class PetRestController { @Autowired private ClinicService clinicService; - @RequestMapping(value = "/{petId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) + @RequestMapping(value = "/{petId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<Pet> getPet(@PathVariable("petId") int petId){ Pet pet = this.clinicService.findPetById(petId); if(pet == null){ @@ -60,7 +60,7 @@ public class PetRestController { return new ResponseEntity<Pet>(pet, HttpStatus.OK); } - @RequestMapping(value = "", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) + @RequestMapping(value = "", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<Collection<Pet>> getPets(){ Collection<Pet> pets = this.clinicService.findAllPets(); if(pets.isEmpty()){ @@ -69,12 +69,12 @@ public class PetRestController { return new ResponseEntity<Collection<Pet>>(pets, HttpStatus.OK); } - @RequestMapping(value = "/pettypes", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) + @RequestMapping(value = "/pettypes", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<Collection<PetType>> getPetTypes(){ return new ResponseEntity<Collection<PetType>>(this.clinicService.findPetTypes(), HttpStatus.OK); } - @RequestMapping(value = "", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) + @RequestMapping(value = "", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<Pet> addPet(@RequestBody @Valid Pet pet, BindingResult bindingResult, UriComponentsBuilder ucBuilder){ BindingErrorsResponse errors = new BindingErrorsResponse(); HttpHeaders headers = new HttpHeaders(); @@ -88,7 +88,7 @@ public class PetRestController { return new ResponseEntity<Pet>(pet, headers, HttpStatus.CREATED); } - @RequestMapping(value = "/{petId}", method = RequestMethod.PUT, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) + @RequestMapping(value = "/{petId}", method = RequestMethod.PUT, produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<Pet> updatePet(@PathVariable("petId") int petId, @RequestBody @Valid Pet pet, BindingResult bindingResult){ BindingErrorsResponse errors = new BindingErrorsResponse(); HttpHeaders headers = new HttpHeaders(); @@ -109,7 +109,7 @@ public class PetRestController { return new ResponseEntity<Pet>(currentPet, HttpStatus.NO_CONTENT); } - @RequestMapping(value = "/{petId}", method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) + @RequestMapping(value = "/{petId}", method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VALUE) @Transactional public ResponseEntity<Void> deletePet(@PathVariable("petId") int petId){ Pet pet = this.clinicService.findPetById(petId);