Я пишу REST API. Для этого у меня есть один класс Location DTO, который я использую в качестве входного параметра в двух местах, сначала как место происхождения и второй как место назначения для REST API. Но Swagger не отображает все поля DTO дважды. Ниже REST API и запрошенный объект
@GetMapping(value = "/")
@ApiOperation(value = "Get Workflow Configurations", produces = "application/json", consumes = "application/json")
@ApiResponses(value = {@ApiResponse(code = 200, message = "The GET call is Successful"),
@ApiResponse(code = 500, message = "The GET call is Failed"),
@ApiResponse(code = 404, message = "The API could not be found"),
@ApiResponse(code = 400, message = "Invalid input")})
public ResponseEntity<List<WorkflowConfigurationResponse>> getWorkflowConfigurations(
@ApiParam("Origin Location") @Valid WorkflowLocationRequest origin,
@ApiParam("Destination Location") @Valid WorkflowLocationRequest destination,
@ApiParam("originatorCode") @RequestParam String orgCode,
@ApiParam("Status") @RequestParam(required = false) String status,
@ApiParam("customerCode") @RequestParam(required = false) String customerCode) {
logger.info("getWorkflowConfigurationsForBooking");
return ResponseEntity.ok(workflowService.getWorkflowConfigurationsByLocation(origin, destination, orgCode, status, customerCode));
}
@Getter
@Setter
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class WorkflowLocationRequest {
private String uuid;
private String address1;
private String address2;
private String plusCode;
private String codeType;
private String type;
private String name;
private String city;
private String state;
private String country;
private String postalCode;
private String geoHierarchy;
}