I am trying to do some documentation to my small api. What should I do in situation when on status code 400 I can have 2 possible descriptions? I would like to do something like:
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "description",
content = {@Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
schema = @Schema(implementation = StudentFullDTO.class))}),
@ApiResponse(responseCode = "400", description = "description" +
"ExceptionResponseObject", content = @Content),
@ApiResponse(responseCode = "400", description = "Odescription",
content = @Content)})
@PatchMapping("/{id}")
public ResponseEntity<StudentFullDTO> patch(@PathVariable String id,
@RequestBody @Valid Map<Object, Object> fields) {
StudentEntity studentEntity = studentEntityService.patchStudentEntity(id, fields);
StudentFullDTO studentFullDTO = modelMapperService.mapObjectToObjectOfEnteredClass(studentEntity, StudentFullDTO.class);
return new ResponseEntity<>(studentFullDTO, HttpStatus.OK);
}
Is it possible to define the same status multiple times?