diff --git a/src/main/java/org/openepics/names/rest/api/v1/INames.java b/src/main/java/org/openepics/names/rest/api/v1/INames.java index 604fc7fd4657b655f26766f2591825bec0e6b9f3..759e6e916178a63899fe824c1a016bee475d364e 100644 --- a/src/main/java/org/openepics/names/rest/api/v1/INames.java +++ b/src/main/java/org/openepics/names/rest/api/v1/INames.java @@ -123,29 +123,31 @@ public interface INames { description = "Create names by array of name elements. " + "Return array of created name elements." + "\n\n" - + "Name element attributes required: \n" - + "- name \n" + + "Required attributes: \n" + + "- parentsystemstructure \n" + "- description \n" + "- comment \n" - + "- either of \n" - + "-- subsystem \n" - + "-- subsystem, device type, index \n" - + "-- system \n" - + "-- system, device type, index \n" - + "-- system group \n" - + "-- system group, device type, index" + + "\n\n" + + "Uuid is created by Naming." ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Return array of created name elements.", content = @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = NameElement.class)))), - @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), - @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) + @ApiResponse(responseCode = "200", description = "Method completed OK. Return array of created name elements.", + content = @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = NameElement.class)))), + @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), + @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) }) @RequestMapping( method = RequestMethod.POST, produces = {"application/json"}, consumes = {"application/json"}) public List<NameElement> createNames( - @Parameter(in = ParameterIn.DEFAULT, description = "array of name elements", required = true) @RequestBody(required = true) List<NameElementCommand> nameElements); + @Parameter(in = ParameterIn.DEFAULT, description = "array of name elements", required = true, + content = @Content(mediaType = "application/json", + array = @ArraySchema(schema = @Schema(implementation = NameElementCommand.class, + requiredProperties = {"parentsystemstructure","parentdevicestructure","index","description","comment"})))) + @RequestBody List<NameElementCommand> nameElements); // ---------------------------------------------------------------------------------------------------- @@ -153,7 +155,8 @@ public interface INames { * Find valid names (search). * Return paged list of name elements. * - * @param deleted if deleted-only names are to be included (false for non-deleted-only names, true for deleted-only names, not used for both cases) + * @param deleted if deleted-only names are to be included + * (false for non-deleted-only names, true for deleted-only names, not used for both cases) * @param queryFields search fields * @param queryValues search values corresponding to search fields * @param orderBy order by field @@ -168,9 +171,12 @@ public interface INames { + "Return paged array of name elements." ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Return paged array of name elements.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponsePageNameElements.class))), - @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), - @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) + @ApiResponse(responseCode = "200", description = "Method completed OK. Return paged array of name elements.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponsePageNameElements.class))), + @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), + @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) }) @RequestMapping( method = RequestMethod.GET, @@ -201,9 +207,12 @@ public interface INames { + "Return paged array of name elements." ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Return paged array of name elements.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponsePageNameElements.class))), - @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), - @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) + @ApiResponse(responseCode = "200", description = "Method completed OK. Return paged array of name elements.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponsePageNameElements.class))), + @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), + @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) }) @RequestMapping( value = "/{name}", @@ -233,9 +242,12 @@ public interface INames { + "Return paged array of name elements." ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Return paged array of name elements.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponsePageNameElements.class))), - @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), - @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) + @ApiResponse(responseCode = "200", description = "Method completed OK. Return paged array of name elements.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponsePageNameElements.class))), + @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), + @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) }) @RequestMapping( value = "/systemstructure/{mnemonicpath}", @@ -265,9 +277,12 @@ public interface INames { + "Return paged array of name elements." ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Return paged array of name elements.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponsePageNameElements.class))), - @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), - @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) + @ApiResponse(responseCode = "200", description = "Method completed OK. Return paged array of name elements.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponsePageNameElements.class))), + @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), + @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) }) @RequestMapping( value = "/devicestructure/{mnemonicpath}", @@ -297,9 +312,12 @@ public interface INames { + "Return paged array of name elements." ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Return paged array of name elements.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponsePageNameElements.class))), - @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), - @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) + @ApiResponse(responseCode = "200", description = "Method completed OK. Return paged array of name elements.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponsePageNameElements.class))), + @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), + @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) }) @RequestMapping( value = "/history/{uuid}", @@ -325,9 +343,12 @@ public interface INames { description = "Return name equivalence for name." ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Return name equivalence.", content = @Content(mediaType = "text/plain", schema = @Schema(implementation = String.class))), - @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), - @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) + @ApiResponse(responseCode = "200", description = "Method completed OK. Return name equivalence.", + content = @Content(mediaType = "text/plain", schema = @Schema(implementation = String.class))), + @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), + @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) }) @RequestMapping( @@ -340,7 +361,8 @@ public interface INames { * Return if name exists (exact match). * * <p> - * Response is true if name exists, false otherwise. Message and details are available if no response is available. + * Response is true if name exists, false otherwise. + * Message and details are available if no response is available. * </p> * * @param name name to check if it exists @@ -351,9 +373,13 @@ public interface INames { description = "Return if name exists (exact match)." ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Response is true if name exists, false otherwise. Message and details are available if no response is available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseBoolean.class))), - @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), - @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) + @ApiResponse(responseCode = "200", description = "Method completed OK. Response is true if name exists, false otherwise. " + + "Message and details are available if no response is available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseBoolean.class))), + @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), + @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) }) @RequestMapping( value = "/exists/{name}", @@ -367,7 +393,8 @@ public interface INames { * A name is considered legacy name if one or more of its parents is deleted. * * <p> - * Response is true if name is legacy name, false otherwise. Message and details are available if no response is available. + * Response is true if name is legacy name, false otherwise. + * Message and details are available if no response is available. * </p> * * @param name name to check if it is legacy name @@ -379,9 +406,13 @@ public interface INames { + "A name is considered legacy name if one or more of its parents is deleted." ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Response is true if name is legacy name, false otherwise. Message and details are available if no response is available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseBoolean.class))), - @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), - @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) + @ApiResponse(responseCode = "200", description = "Method completed OK. Response is true if name is legacy name, false otherwise. " + + "Message and details are available if no response is available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseBoolean.class))), + @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), + @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) }) @RequestMapping( value = "/islegacy/{name}", @@ -395,7 +426,8 @@ public interface INames { * Method answers question 'would it be ok to create given name?'. * * <p> - * Response is true if name is valid to create, false otherwise. Message and details are available if no response is available. + * Response is true if name is valid to create, false otherwise. + * Message and details are available if no response is available. * </p> * * @param name name to check if it is valid to create @@ -407,9 +439,13 @@ public interface INames { + "Method answers question 'would it be ok to create given name?'." ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Response is true if name is valid to create, false otherwise. Message and details are available if no response is available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseBoolean.class))), - @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), - @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) + @ApiResponse(responseCode = "200", description = "Method completed OK. Response is true if name is valid to create, false otherwise. " + + "Message and details are available if no response is available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseBoolean.class))), + @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), + @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) }) @RequestMapping( value = "/isvalidtocreate/{name}", @@ -425,7 +461,8 @@ public interface INames { * If names are valid to create, successful create of names can be expected. * * <p> - * Response is true if all name elements validated ok, false otherwise, responses contain array with result for each name element. Message and details are available if no response is available. + * Response is true if all name elements validated ok, false otherwise, responses contain array + * with result for each name element. Message and details are available if no response is available. * </p> * * @param nameElements list of name elements @@ -437,22 +474,19 @@ public interface INames { description = "Return if name elements are valid to create. " + "If names are valid to create, successful create of names can be expected." + "\n\n" - + "Name element attributes required: \n" - + "- name \n" + + "Required attributes: \n" + + "- parentsystemstructure \n" + "- description \n" - + "- comment \n" - + "- either of \n" - + "-- subsystem \n" - + "-- subsystem, device type, index \n" - + "-- system \n" - + "-- system, device type, index \n" - + "-- system group \n" - + "-- system group, device type, index" + + "- comment" ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Response is true if all name elements validated ok, false otherwise, responses contain array with result for each name element. Message and details are available if no response is available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseBooleanList.class))), - @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), - @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) + @ApiResponse(responseCode = "200", description = "Method completed OK. Response is true if all name elements validated ok, false otherwise. " + + "Responses contain array with result for each name element. Message and details are available if no response is available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseBooleanList.class))), + @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), + @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) }) @RequestMapping( value = "/validatecreate", @@ -460,14 +494,19 @@ public interface INames { produces = {"application/json"}, consumes = {"application/json"}) public ResponseEntity<ResponseBooleanList> validateNamesCreate( - @Parameter(in = ParameterIn.DEFAULT, description = "array of name elements", required = true) @RequestBody(required = true) List<NameElementCommand> nameElements); + @Parameter(in = ParameterIn.DEFAULT, description = "array of name elements", required = true, + content = @Content(mediaType = "application/json", + array = @ArraySchema(schema = @Schema(implementation = NameElementCommand.class, + requiredProperties = {"parentsystemstructure","parentdevicestructure","index","description","comment"})))) + @RequestBody List<NameElementCommand> nameElements); /** * Return if name elements are valid to update. * If names are valid to update, successful update of names can be expected. * * <p> - * Response is true if all name elements validated ok, false otherwise, responses contain array with result for each name element. Message and details are available if no response is available. + * Response is true if all name elements validated ok, false otherwise, responses contain array + * with result for each name element. Message and details are available if no response is available. * </p> * * @param nameElements list of name elements @@ -479,22 +518,20 @@ public interface INames { description = "Return if name elements are valid to update. " + "If names are valid to update, successful update of names can be expected." + "\n\n" - + "Name element attributes required: \n" - + "- name \n" + + "Required attributes: \n" + + "- uuid \n" + + "- parentsystemstructure \n" + "- description \n" - + "- comment \n" - + "- either of \n" - + "-- subsystem \n" - + "-- subsystem, device type, index \n" - + "-- system \n" - + "-- system, device type, index \n" - + "-- system group \n" - + "-- system group, device type, index" + + "- comment" ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Response is true if all name elements validated ok, false otherwise, responses contain array with result for each name element. Message and details are available if no response is available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseBooleanList.class))), - @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), - @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) + @ApiResponse(responseCode = "200", description = "Method completed OK. Response is true if all name elements validated ok, false otherwise. " + + "Responses contain array with result for each name element. Message and details are available if no response is available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseBooleanList.class))), + @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), + @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) }) @RequestMapping( value = "/validateupdate", @@ -502,14 +539,19 @@ public interface INames { produces = {"application/json"}, consumes = {"application/json"}) public ResponseEntity<ResponseBooleanList> validateNamesUpdate( - @Parameter(in = ParameterIn.DEFAULT, description = "array of name elements", required = true) @RequestBody(required = true) List<NameElementCommand> nameElements); + @Parameter(in = ParameterIn.DEFAULT, description = "array of name elements", required = true, + content = @Content(mediaType = "application/json", + array = @ArraySchema(schema = @Schema(implementation = NameElementCommand.class, + requiredProperties = {"uuid","parentsystemstructure","description","comment"})))) + @RequestBody List<NameElementCommand> nameElements); /** * Return if name elements are valid to delete. * If names are valid to update, successful delete of names can be expected. * * <p> - * Response is true if all name elements validated ok, false otherwise, responses contain array with result for each name element. Message and details are available if no response is available. + * Response is true if all name elements validated ok, false otherwise, responses contain array + * with result for each name element. Message and details are available if no response is available. * </p> * * @param nameElements list of name elements @@ -521,22 +563,18 @@ public interface INames { description = "Return if name elements are valid to delete. " + "If names are valid to update, successful delete of names can be expected." + "\n\n" - + "Name element attributes required: \n" - + "- name \n" - + "- description \n" - + "- comment \n" - + "- either of \n" - + "-- subsystem \n" - + "-- subsystem, device type, index \n" - + "-- system \n" - + "-- system, device type, index \n" - + "-- system group \n" - + "-- system group, device type, index" + + "Required attributes: \n" + + "- uuid \n" + + "- comment" ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Response is true if all name elements validated ok, false otherwise, responses contain array with result for each name element. Message and details are available if no response is available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseBooleanList.class))), - @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), - @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) + @ApiResponse(responseCode = "200", description = "Method completed OK. Response is true if all name elements validated ok, false otherwise. " + + "Responses contain array with result for each name element. Message and details are available if no response is available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseBooleanList.class))), + @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), + @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) }) @RequestMapping( value = "/validatedelete", @@ -544,7 +582,11 @@ public interface INames { produces = {"application/json"}, consumes = {"application/json"}) public ResponseEntity<ResponseBooleanList> validateNamesDelete( - @Parameter(in = ParameterIn.DEFAULT, description = "array of name elements", required = true) @RequestBody(required = true) List<NameElementCommand> nameElements); + @Parameter(in = ParameterIn.DEFAULT, description = "array of name elements", required = true, + content = @Content(mediaType = "application/json", + array = @ArraySchema(schema = @Schema(implementation = NameElementCommand.class, + requiredProperties = {"uuid","comment"})))) + @RequestBody List<NameElementCommand> nameElements); // ---------------------------------------------------------------------------------------------------- @@ -560,22 +602,21 @@ public interface INames { description = "Update names by array of name elements. " + "Return array of updated name elements." + "\n\n" - + "Name element attributes required: \n" - + "- name \n" + + "Required attributes: \n" + + "- uuid \n" + + "- parentsystemstructure \n" + "- description \n" + "- comment \n" - + "- either of \n" - + "-- subsystem \n" - + "-- subsystem, device type, index \n" - + "-- system \n" - + "-- system, device type, index \n" - + "-- system group \n" - + "-- system group, device type, index" + + "\n\n" + + "Other attributes are optional." ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Return array of updated name elements.", content = @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = NameElement.class)))), - @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), - @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) + @ApiResponse(responseCode = "200", description = "Method completed OK. Return array of updated name elements.", + content = @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = NameElement.class)))), + @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), + @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) }) @RequestMapping( method = RequestMethod.PUT, @@ -583,7 +624,11 @@ public interface INames { consumes = {"application/json"}) @PutMapping public List<NameElement> updateNames( - @Parameter(in = ParameterIn.DEFAULT, description = "array of name elements", required = true) @RequestBody(required = true) List<NameElementCommand> nameElements); + @Parameter(in = ParameterIn.DEFAULT, description = "array of name elements", required = true, + content = @Content(mediaType = "application/json", + array = @ArraySchema(schema = @Schema(implementation = NameElementCommand.class, + requiredProperties = {"uuid","parentsystemstructure","description","comment"})))) + @RequestBody List<NameElementCommand> nameElements); // ---------------------------------------------------------------------------------------------------- @@ -599,28 +644,29 @@ public interface INames { description = "Delete names by array of name elements. " + "Return array of deleted name elements." + "\n\n" - + "Name element attributes required: \n" - + "- name \n" - + "- description \n" + + "Required attributes: \n" + + "- uuid \n" + "- comment \n" - + "- either of \n" - + "-- subsystem \n" - + "-- subsystem, device type, index \n" - + "-- system \n" - + "-- system, device type, index \n" - + "-- system group \n" - + "-- system group, device type, index" + + "\n\n" + + "Other attributes are not considered." ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Return array of deleted name elements.", content = @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = NameElement.class)))), - @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), - @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) + @ApiResponse(responseCode = "200", description = "Method completed OK. Return array of deleted name elements.", + content = @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = NameElement.class)))), + @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), + @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) }) @RequestMapping( method = RequestMethod.DELETE, produces = {"application/json"}, consumes = {"application/json"}) public List<NameElement> deleteNames( - @Parameter(in = ParameterIn.DEFAULT, description = "array of name elements", required = true) @RequestBody(required = true) List<NameElementCommand> nameElements); + @Parameter(in = ParameterIn.DEFAULT, description = "array of name elements", required = true, + content = @Content(mediaType = "application/json", + array = @ArraySchema(schema = @Schema(implementation = NameElementCommand.class, + requiredProperties = {"uuid","comment"})))) + @RequestBody List<NameElementCommand> nameElements); } diff --git a/src/main/java/org/openepics/names/rest/api/v1/IStructures.java b/src/main/java/org/openepics/names/rest/api/v1/IStructures.java index 1dba0b7e45123cc2a1e6524a5f50e6f4cfe4a8be..126dbe9fcb6dbf3f57f6c6253269176fa6a84c94 100644 --- a/src/main/java/org/openepics/names/rest/api/v1/IStructures.java +++ b/src/main/java/org/openepics/names/rest/api/v1/IStructures.java @@ -128,7 +128,8 @@ public interface IStructures { * <li>type</li> * <li>parent (System, Subsystem, DeviceGroup, DeviceType)</li> * <li>name</li> - * <li>mnemonic (System, Subsystem, Discipline, DeviceType)(may be set for SystemGroup, not allowed for DeviceGroup)</li> + * <li>mnemonic (System, Subsystem, Discipline, DeviceType) + * (may be set for SystemGroup, not allowed for DeviceGroup)</li> * <li>description</li> * <li>comment</li> * </ul> @@ -142,25 +143,34 @@ public interface IStructures { description = "Create (propose) structures by array of structure elements. " + "Return array of created structure elements (proposals)." + "\n\n" - + "Structure element attributes required: \n" + + "Required attributes: \n" + "- type \n" + "- parent (System, Subsystem, DeviceGroup, DeviceType) \n" + "- name \n" + "- mnemonic (System, Subsystem, Discipline, DeviceType, may be set for SystemGroup, not allowed for DeviceGroup) \n" + "- description \n" - + "- comment" + + "- comment \n" + + "\n\n" + + "Uuid is created by Naming." ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Return array of structure elements for created structures (proposals).", content = @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = StructureElement.class)))), - @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), - @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) + @ApiResponse(responseCode = "200", description = "Method completed OK. Return array of structure elements for created structures (proposals).", + content = @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = StructureElement.class)))), + @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), + @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) }) @RequestMapping( method = RequestMethod.POST, produces = {"application/json"}, consumes = {"application/json"}) public List<StructureElement> createStructures( - @Parameter(in = ParameterIn.DEFAULT, description = "array of structure elements", required = true) @RequestBody(required = true) List<StructureElementCommand> structureElements); + @Parameter(in = ParameterIn.DEFAULT, description = "array of structure elements", required = true, + content = @Content(mediaType = "application/json", + array = @ArraySchema(schema = @Schema(implementation = StructureElementCommand.class, + requiredProperties = {"type","parent","name","mnemonic","description","comment"})))) + @RequestBody List<StructureElementCommand> structureElements); // ---------------------------------------------------------------------------------------------------- @@ -170,7 +180,8 @@ public interface IStructures { * * @param type type of structure to search in * @param statuses statuses of structures to search for - * @param deleted if deleted-only structures are to be included (false for non-deleted-only structures, true for deleted-only structures, not used for both cases) + * @param deleted if deleted-only structures are to be included + * (false for non-deleted-only structures, true for deleted-only structures, not used for both cases) * @param queryFields search fields * @param queryValues search values corresponding to search fields * @param orderBy order by field @@ -185,9 +196,12 @@ public interface IStructures { + "Return paged array of structure elements." ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Return paged array of structure elements.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponsePageStructureElements.class))), - @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), - @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) + @ApiResponse(responseCode = "200", description = "Method completed OK. Return paged array of structure elements.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponsePageStructureElements.class))), + @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), + @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) }) @RequestMapping( value = "/{type}", @@ -223,9 +237,12 @@ public interface IStructures { + "Return paged array of structure elements." ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Return paged array of structure elements.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponsePageStructureElements.class))), - @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), - @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) + @ApiResponse(responseCode = "200", description = "Method completed OK. Return paged array of structure elements.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponsePageStructureElements.class))), + @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), + @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) }) @RequestMapping( value = "/children/{type}/{uuid}", @@ -257,9 +274,12 @@ public interface IStructures { + "Return paged array of structure elements." ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Return paged array of structure elements.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponsePageStructureElements.class))), - @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), - @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) + @ApiResponse(responseCode = "200", description = "Method completed OK. Return paged array of structure elements.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponsePageStructureElements.class))), + @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), + @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) }) @RequestMapping( value = "/mnemonic/{mnemonic}", @@ -290,9 +310,12 @@ public interface IStructures { + "Return paged array of structure elements." ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Return paged array of structure elements.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponsePageStructureElements.class))), - @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), - @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) + @ApiResponse(responseCode = "200", description = "Method completed OK. Return paged array of structure elements.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponsePageStructureElements.class))), + @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), + @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) }) @RequestMapping( value = "/mnemonicpath/{mnemonicpath}", @@ -324,9 +347,12 @@ public interface IStructures { + "Return paged array of structure elements." ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Return paged array of structure elements.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponsePageStructureElements.class))), - @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), - @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) + @ApiResponse(responseCode = "200", description = "Method completed OK. Return paged array of structure elements.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponsePageStructureElements.class))), + @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), + @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) }) @RequestMapping( value = "/history/{uuid}", @@ -353,9 +379,12 @@ public interface IStructures { description = "Return mnemonic equivalence for mnemonic." ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Return mnemonic equivalence.", content = @Content(mediaType = "text/plain", schema = @Schema(implementation = String.class))), - @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), - @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) + @ApiResponse(responseCode = "200", description = "Method completed OK. Return mnemonic equivalence.", + content = @Content(mediaType = "text/plain", schema = @Schema(implementation = String.class))), + @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), + @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) }) @RequestMapping( @@ -386,9 +415,13 @@ public interface IStructures { + "Returned object has three fields (message, details, response)." ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Response is true if mnemonic path exists, false otherwise. Message and details are available if no response is available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseBoolean.class))), - @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), - @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) + @ApiResponse(responseCode = "200", description = "Method completed OK. Response is true if mnemonic path exists, false otherwise. " + + "Message and details are available if no response is available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseBoolean.class))), + @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), + @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) }) @RequestMapping( value = "/exists/{type}/{mnemonicpath}", @@ -423,9 +456,13 @@ public interface IStructures { + "that a device type belongs." ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Response is true if structure is valid to create, false otherwise. Message and details are available if no response is available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseBoolean.class))), - @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), - @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) + @ApiResponse(responseCode = "200", description = "Method completed OK. Response is true if structure is valid to create, false otherwise. " + + "Message and details are available if no response is available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseBoolean.class))), + @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), + @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) }) @RequestMapping( value = "/isvalidtocreate/{type}/{mnemonicpath}", @@ -460,7 +497,7 @@ public interface IStructures { description = "Return if structure elements are valid to create (propose). " + "If structure elements are valid to create, successful create of structures can be expected." + "\n\n" - + "Structure element attributes required: \n" + + "Required attributes: \n" + "- type \n" + "- parent (System, Subsystem, DeviceGroup, DeviceType) \n" + "- name \n" @@ -469,9 +506,13 @@ public interface IStructures { + "- comment" ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Response is true if all structure elements validated ok, false otherwise, responses contain array with result for each structure element. Message and details are available if no response is available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseBooleanList.class))), - @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), - @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) + @ApiResponse(responseCode = "200", description = "Method completed OK. Response is true if all structure elements validated ok, false otherwise. " + + "Responses contain array with result for each structure element. Message and details are available if no response is available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseBooleanList.class))), + @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), + @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) }) @RequestMapping( value = "/validatecreate", @@ -479,7 +520,11 @@ public interface IStructures { produces = {"application/json"}, consumes = {"application/json"}) public ResponseEntity<ResponseBooleanList> validateStructuresCreate( - @Parameter(in = ParameterIn.DEFAULT, description = "array of structure elements", required = true) @RequestBody(required = true) List<StructureElementCommand> structureElements); + @Parameter(in = ParameterIn.DEFAULT, description = "array of structure elements", required = true, + content = @Content(mediaType = "application/json", + array = @ArraySchema(schema = @Schema(implementation = StructureElementCommand.class, + requiredProperties = {"type","parent","name","mnemonic","description","comment"})))) + @RequestBody List<StructureElementCommand> structureElements); /** * Return if structure elements are valid to update (propose). @@ -504,7 +549,8 @@ public interface IStructures { description = "Return if structure elements are valid to update (propose). " + "If structure elements are valid to update, successful update of structures can be expected." + "\n\n" - + "Structure element attributes required: \n" + + "Required attributes: \n" + + "- uuid \n" + "- type \n" + "- parent (System, Subsystem, DeviceGroup, DeviceType) \n" + "- name \n" @@ -513,9 +559,13 @@ public interface IStructures { + "- comment" ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Response is true if all structure elements validated ok, false otherwise, responses contain array with result for each structure element. Message and details are available if no response is available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseBooleanList.class))), - @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), - @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) + @ApiResponse(responseCode = "200", description = "Method completed OK. Response is true if all structure elements validated ok, false otherwise. " + + "Responses contain array with result for each structure element. Message and details are available if no response is available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseBooleanList.class))), + @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), + @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) }) @RequestMapping( value = "/validateupdate", @@ -523,7 +573,11 @@ public interface IStructures { produces = {"application/json"}, consumes = {"application/json"}) public ResponseEntity<ResponseBooleanList> validateStructuresUpdate( - @Parameter(in = ParameterIn.DEFAULT, description = "array of structure elements", required = true) @RequestBody(required = true) List<StructureElementCommand> structureElements); + @Parameter(in = ParameterIn.DEFAULT, description = "array of structure elements", required = true, + content = @Content(mediaType = "application/json", + array = @ArraySchema(schema = @Schema(implementation = StructureElementCommand.class, + requiredProperties = {"uuid","type","parent","name","mnemonic","description","comment"})))) + @RequestBody List<StructureElementCommand> structureElements); /** * Return if structure elements are valid to delete (propose). @@ -548,18 +602,19 @@ public interface IStructures { description = "Return if structure elements are valid to delete (propose). " + "If structure elements are valid to delete, successful delete of structures can be expected." + "\n\n" - + "Structure element attributes required: \n" + + "Required attributes: \n" + + "- uuid \n" + "- type \n" - + "- parent (System, Subsystem, DeviceGroup, DeviceType) \n" - + "- name \n" - + "- mnemonic (System, Subsystem, Discipline, DeviceType, may be set for SystemGroup, not allowed for DeviceGroup) \n" - + "- description \n" + "- comment" ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Response is true if all structure elements validated ok, false otherwise, responses contain array with result for each structure element. Message and details are available if no response is available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseBooleanList.class))), - @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), - @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) + @ApiResponse(responseCode = "200", description = "Method completed OK. Response is true if all structure elements validated ok, false otherwise. " + + "Responses contain array with result for each structure element. Message and details are available if no response is available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseBooleanList.class))), + @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), + @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) }) @RequestMapping( value = "/validatedelete", @@ -567,7 +622,11 @@ public interface IStructures { produces = {"application/json"}, consumes = {"application/json"}) public ResponseEntity<ResponseBooleanList> validateStructuresDelete( - @Parameter(in = ParameterIn.DEFAULT, description = "array of structure elements", required = true) @RequestBody(required = true) List<StructureElementCommand> structureElements); + @Parameter(in = ParameterIn.DEFAULT, description = "array of structure elements", required = true, + content = @Content(mediaType = "application/json", + array = @ArraySchema(schema = @Schema(implementation = StructureElementCommand.class, + requiredProperties = {"uuid","type","comment"})))) + @RequestBody List<StructureElementCommand> structureElements); /** * Return if structure elements are valid to approve. @@ -592,7 +651,8 @@ public interface IStructures { description = "Return if structure elements are valid to approve. " + "If structure elements are valid to approve, successful approve of structures can be expected." + "\n\n" - + "Structure element attributes required: \n" + + "Required attributes: \n" + + "- uuid \n" + "- type \n" + "- parent (System, Subsystem, DeviceGroup, DeviceType) \n" + "- name \n" @@ -601,9 +661,13 @@ public interface IStructures { + "- comment" ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Response is true if all structure elements validated ok, false otherwise, responses contain array with result for each structure element. Message and details are available if no response is available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseBooleanList.class))), - @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), - @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) + @ApiResponse(responseCode = "200", description = "Method completed OK. Response is true if all structure elements validated ok, false otherwise. " + + "Responses contain array with result for each structure element. Message and details are available if no response is available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseBooleanList.class))), + @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), + @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) }) @RequestMapping( value = "/validateapprove", @@ -611,7 +675,11 @@ public interface IStructures { produces = {"application/json"}, consumes = {"application/json"}) public ResponseEntity<ResponseBooleanList> validateStructuresApprove( - @Parameter(in = ParameterIn.DEFAULT, description = "array of structure elements", required = true) @RequestBody(required = true) List<StructureElementCommand> structureElements); + @Parameter(in = ParameterIn.DEFAULT, description = "array of structure elements", required = true, + content = @Content(mediaType = "application/json", + array = @ArraySchema(schema = @Schema(implementation = StructureElementCommand.class, + requiredProperties = {"uuid","type","parent","name","mnemonic","description","comment"})))) + @RequestBody List<StructureElementCommand> structureElements); /** * Return if structure elements are valid to cancel. @@ -636,7 +704,8 @@ public interface IStructures { description = "Return if structure elements are valid to cancel. " + "If structure elements are valid to cancel, successful cancel of structures can be expected." + "\n\n" - + "Structure element attributes required: \n" + + "Required attributes: \n" + + "- uuid \n" + "- type \n" + "- parent (System, Subsystem, DeviceGroup, DeviceType) \n" + "- name \n" @@ -645,9 +714,13 @@ public interface IStructures { + "- comment" ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Response is true if all structure elements validated ok, false otherwise, responses contain array with result for each structure element. Message and details are available if no response is available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseBooleanList.class))), - @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), - @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) + @ApiResponse(responseCode = "200", description = "Method completed OK. Response is true if all structure elements validated ok, false otherwise. " + + "Responses contain array with result for each structure element. Message and details are available if no response is available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseBooleanList.class))), + @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), + @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) }) @RequestMapping( value = "/validatecancel", @@ -655,7 +728,11 @@ public interface IStructures { produces = {"application/json"}, consumes = {"application/json"}) public ResponseEntity<ResponseBooleanList> validateStructuresCancel( - @Parameter(in = ParameterIn.DEFAULT, description = "array of structure elements", required = true) @RequestBody(required = true) List<StructureElementCommand> structureElements); + @Parameter(in = ParameterIn.DEFAULT, description = "array of structure elements", required = true, + content = @Content(mediaType = "application/json", + array = @ArraySchema(schema = @Schema(implementation = StructureElementCommand.class, + requiredProperties = {"uuid","type","parent","name","mnemonic","description","comment"})))) + @RequestBody List<StructureElementCommand> structureElements); /** * Return if structure elements are valid to reject. @@ -680,7 +757,8 @@ public interface IStructures { description = "Return if structure elements are valid to reject. " + "If structure elements are valid to reject, successful reject of structures can be expected." + "\n\n" - + "Structure element attributes required: \n" + + "Required attributes: \n" + + "- uuid \n" + "- type \n" + "- parent (System, Subsystem, DeviceGroup, DeviceType) \n" + "- name \n" @@ -689,9 +767,13 @@ public interface IStructures { + "- comment" ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Response is true if all structure elements validated ok, false otherwise, responses contain array with result for each structure element. Message and details are available if no response is available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseBooleanList.class))), - @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), - @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) + @ApiResponse(responseCode = "200", description = "Method completed OK. Response is true if all structure elements validated ok, false otherwise. " + + "Responses contain array with result for each structure element. Message and details are available if no response is available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponseBooleanList.class))), + @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), + @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) }) @RequestMapping( value = "/validatereject", @@ -699,7 +781,11 @@ public interface IStructures { produces = {"application/json"}, consumes = {"application/json"}) public ResponseEntity<ResponseBooleanList> validateStructuresReject( - @Parameter(in = ParameterIn.DEFAULT, description = "array of structure elements", required = true) @RequestBody(required = true) List<StructureElementCommand> structureElements); + @Parameter(in = ParameterIn.DEFAULT, description = "array of structure elements", required = true, + content = @Content(mediaType = "application/json", + array = @ArraySchema(schema = @Schema(implementation = StructureElementCommand.class, + requiredProperties = {"uuid","type","parent","name","mnemonic","description","comment"})))) + @RequestBody List<StructureElementCommand> structureElements); // ---------------------------------------------------------------------------------------------------- @@ -715,7 +801,8 @@ public interface IStructures { description = "Update (propose) structures by array of structure elements. " + "Return array of updated structure elements (proposals)." + "\n\n" - + "Structure element attributes required: \n" + + "Required attributes: \n" + + "- uuid \n" + "- type \n" + "- parent (System, Subsystem, DeviceGroup, DeviceType) \n" + "- name \n" @@ -724,16 +811,23 @@ public interface IStructures { + "- comment" ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Return array of structure elements for updated structures (proposals).", content = @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = StructureElement.class)))), - @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), - @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) + @ApiResponse(responseCode = "200", description = "Method completed OK. Return array of structure elements for updated structures (proposals).", + content = @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = StructureElement.class)))), + @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), + @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) }) @RequestMapping( method = RequestMethod.PUT, produces = {"application/json"}, consumes = {"application/json"}) public List<StructureElement> updateStructures( - @Parameter(in = ParameterIn.DEFAULT, description = "array of structure elements", required = true) @RequestBody(required = true) List<StructureElementCommand> structureElements); + @Parameter(in = ParameterIn.DEFAULT, description = "array of structure elements", required = true, + content = @Content(mediaType = "application/json", + array = @ArraySchema(schema = @Schema(implementation = StructureElementCommand.class, + requiredProperties = {"uuid","type","parent","name","mnemonic","description","comment"})))) + @RequestBody List<StructureElementCommand> structureElements); // ---------------------------------------------------------------------------------------------------- @@ -749,25 +843,32 @@ public interface IStructures { description = "Delete (propose) structures by array of structure elements. " + "Return array of deleted structure elements (proposals)." + "\n\n" - + "Structure element attributes required: \n" + + "Required attributes: \n" + + "- uuid \n" + "- type \n" - + "- parent (System, Subsystem, DeviceGroup, DeviceType) \n" - + "- name \n" - + "- mnemonic (System, Subsystem, Discipline, DeviceType, may be set for SystemGroup, not allowed for DeviceGroup) \n" - + "- description \n" - + "- comment" + + "- comment \n" + + "\n\n" + + "Other attributes are not considered." ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Return array of structure elements for deleted structures (proposals).", content = @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = StructureElement.class)))), - @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), - @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) + @ApiResponse(responseCode = "200", description = "Method completed OK. Return array of structure elements for deleted structures (proposals).", + content = @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = StructureElement.class)))), + @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), + @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) }) @RequestMapping( method = RequestMethod.DELETE, produces = {"application/json"}, consumes = {"application/json"}) public List<StructureElement> deleteStructures( - @Parameter(in = ParameterIn.DEFAULT, description = "array of structure elements", required = true) @RequestBody(required = true) List<StructureElementCommand> structureElements); + @Parameter(in = ParameterIn.DEFAULT, description = "array of structure elements", required = true, + content = @Content(mediaType = "application/json", + array = @ArraySchema(schema = @Schema(implementation = StructureElementCommand.class, + requiredProperties = {"uuid","type","comment"})))) + @RequestBody List<StructureElementCommand> structureElements); + // ---------------------------------------------------------------------------------------------------- @@ -782,11 +883,23 @@ public interface IStructures { summary = "Approve structures (proposals) by array of structure elements", description = "Approve structures (proposals) by array of structure elements. " + "Return array of approved structure elements." + + "\n\n" + + "Required attributes: \n" + + "- uuid \n" + + "- type \n" + + "- parent (System, Subsystem, DeviceGroup, DeviceType) \n" + + "- name \n" + + "- mnemonic (System, Subsystem, Discipline, DeviceType, may be set for SystemGroup, not allowed for DeviceGroup) \n" + + "- description \n" + + "- comment" ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Return array of structure elements for approved structures.", content = @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = StructureElement.class)))), - @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), - @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) + @ApiResponse(responseCode = "200", description = "Method completed OK. Return array of structure elements for approved structures.", + content = @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = StructureElement.class)))), + @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), + @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) }) @RequestMapping( value = "/approve", @@ -794,7 +907,11 @@ public interface IStructures { produces = {"application/json"}, consumes = {"application/json"}) public List<StructureElement> approveStructures( - @Parameter(in = ParameterIn.DEFAULT, description = "array of structure elements", required = true) @RequestBody(required = true) List<StructureElementCommand> structureElements); + @Parameter(in = ParameterIn.DEFAULT, description = "array of structure elements", required = true, + content = @Content(mediaType = "application/json", + array = @ArraySchema(schema = @Schema(implementation = StructureElementCommand.class, + requiredProperties = {"uuid","type","parent","name","mnemonic","description","comment"})))) + @RequestBody List<StructureElementCommand> structureElements); /** * Cancel structures (proposals) by list of structure elements. @@ -807,11 +924,23 @@ public interface IStructures { summary = "Cancel structures (proposals) by array of structure elements", description = "Cancel structures (proposals) by array of structure elements. " + "Return array of cancelled structure elements." - ) + + "\n\n" + + "Required attributes: \n" + + "- uuid \n" + + "- type \n" + + "- parent (System, Subsystem, DeviceGroup, DeviceType) \n" + + "- name \n" + + "- mnemonic (System, Subsystem, Discipline, DeviceType, may be set for SystemGroup, not allowed for DeviceGroup) \n" + + "- description \n" + + "- comment" +) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Return array of structure elements for cancelled structures.", content = @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = StructureElement.class)))), - @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), - @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) + @ApiResponse(responseCode = "200", description = "Method completed OK. Return array of structure elements for cancelled structures.", + content = @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = StructureElement.class)))), + @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), + @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) }) @RequestMapping( value = "/cancel", @@ -819,7 +948,11 @@ public interface IStructures { produces = {"application/json"}, consumes = {"application/json"}) public List<StructureElement> cancelStructures( - @Parameter(in = ParameterIn.DEFAULT, description = "array of structure elements", required = true) @RequestBody(required = true) List<StructureElementCommand> structureElements); + @Parameter(in = ParameterIn.DEFAULT, description = "array of structure elements", required = true, + content = @Content(mediaType = "application/json", + array = @ArraySchema(schema = @Schema(implementation = StructureElementCommand.class, + requiredProperties = {"uuid","type","parent","name","mnemonic","description","comment"})))) + @RequestBody List<StructureElementCommand> structureElements); /** * Reject structures (proposals) by list of structure elements. @@ -832,11 +965,23 @@ public interface IStructures { summary = "Reject structures (proposals) by array of structure elements", description = "Reject structures (proposals) by array of structure elements. " + "Return array of rejected structure elements." + + "\n\n" + + "Required attributes: \n" + + "- uuid \n" + + "- type \n" + + "- parent (System, Subsystem, DeviceGroup, DeviceType) \n" + + "- name \n" + + "- mnemonic (System, Subsystem, Discipline, DeviceType, may be set for SystemGroup, not allowed for DeviceGroup) \n" + + "- description \n" + + "- comment" ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Return array of structure elements for rejected structures.", content = @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = StructureElement.class)))), - @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), - @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) + @ApiResponse(responseCode = "200", description = "Method completed OK. Return array of structure elements for rejected structures.", + content = @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = StructureElement.class)))), + @ApiResponse(responseCode = "400", description = "Bad request. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))), + @ApiResponse(responseCode = "500", description = "Internal server error. Message and details are available.", + content = @Content(mediaType = "application/json", schema = @Schema(implementation = Response.class))) }) @RequestMapping( value = "/reject", @@ -844,6 +989,10 @@ public interface IStructures { produces = {"application/json"}, consumes = {"application/json"}) public List<StructureElement> rejectStructures( - @Parameter(in = ParameterIn.DEFAULT, description = "array of structure elements", required = true) @RequestBody(required = true) List<StructureElementCommand> structureElements); + @Parameter(in = ParameterIn.DEFAULT, description = "array of structure elements", required = true, + content = @Content(mediaType = "application/json", + array = @ArraySchema(schema = @Schema(implementation = StructureElementCommand.class, + requiredProperties = {"uuid","type","parent","name","mnemonic","description","comment"})))) + @RequestBody List<StructureElementCommand> structureElements); }