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 3f1b539efbb3751bd10860ebfa06c68aaaf0f108..9fa26817c48586dd204d336cd7c1a3129ebb9bb7 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 @@ -107,6 +107,7 @@ public interface INames { read GET /names/{name} - both name and uuid (name - exact and search, uuid exact) */ + public static final String DEFAULT_FALSE = "false"; public static final String DEFAULT_PAGE = "0"; public static final String DEFAULT_PAGE_SIZE = "100"; @@ -164,10 +165,10 @@ public interface INames { @Operation( summary = "Find valid names (search)", description = "Find valid names (search). " - + "Return array of name elements." + + "Return paged array of name elements." ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Return array of name elements.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponsePageNameElements.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))) }) @@ -175,7 +176,7 @@ public interface INames { method = RequestMethod.GET, produces = {"application/json"}) public ResponsePageNameElements readNames( - @Parameter(in = ParameterIn.QUERY, description = "if deleted-only names are to be included, false for non-deleted-only names, true for deleted-only names, not used for both cases") @RequestParam(required = false) Boolean deleted, + @Parameter(in = ParameterIn.QUERY, description = "if deleted names are to be included or not, omitted for both deleted and not deleted names") @RequestParam(required = false) Boolean deleted, @Parameter(in = ParameterIn.QUERY, description = "search fields") @RequestParam(required = false) FieldName[] queryFields, @Parameter(in = ParameterIn.QUERY, description = "search values corresponding to search fields") @RequestParam(required = false) String[] queryValues, @Parameter(in = ParameterIn.QUERY, description = "order by field") @RequestParam(required = false) FieldName orderBy, @@ -197,10 +198,10 @@ public interface INames { @Operation( summary = "Find valid names by name or uuid (search)", description = "Find valid names by name or uuid (search). " - + "Return array of name elements." + + "Return paged array of name elements." ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Return array of name elements.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponsePageNameElements.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))) }) @@ -229,10 +230,10 @@ public interface INames { @Operation( summary = "Find valid names by system structure mnemonic path (search)", description = "Find valid names by system structure mnemonic path (search). " - + "Return array of name elements." + + "Return paged array of name elements." ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Return array of name elements.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponsePageNameElements.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))) }) @@ -261,10 +262,10 @@ public interface INames { @Operation( summary = "Find valid names by device structure mnemonic path (search)", description = "Find valid names by device structure mnemonic path (search). " - + "Return array of name elements." + + "Return paged array of name elements." ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Return array of name elements.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponsePageNameElements.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))) }) @@ -293,10 +294,10 @@ public interface INames { @Operation( summary = "Find history for name by uuid (exact match)", description = "Find history for name by uuid (exact match). " - + "Return array of name elements." + + "Return paged array of name elements." ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Return array of name elements.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponsePageNameElements.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))) }) @@ -555,8 +556,8 @@ public interface INames { * @return list of updated name elements */ @Operation( - summary = "Update names by list of name elements", - description = "Update names by list of name elements. " + summary = "Update names by array of name elements", + description = "Update names by array of name elements. " + "Return array of updated name elements." + "\n\n" + "Name element attributes required: \n" @@ -594,8 +595,8 @@ public interface INames { * @return list of deleted name elements */ @Operation( - summary = "Delete names by list of name elements", - description = "Delete names by list of name elements. " + summary = "Delete names by array of name elements", + description = "Delete names by array of name elements. " + "Return array of deleted name elements." + "\n\n" + "Name element attributes required: \n" 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 a6104f92831cb6840290df9409671c06b64f0d27..f8606bbb6a957ea3d96bb8818399268f09435627 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 @@ -114,6 +114,7 @@ public interface IStructures { update PATCH /structures/reject - rejectStructures (List<StructureElement>) */ + public static final String DEFAULT_FALSE = "false"; public static final String DEFAULT_PAGE = "0"; public static final String DEFAULT_PAGE_SIZE = "100"; @@ -137,8 +138,8 @@ public interface IStructures { * @return list of structure elements for created structures (proposals) */ @Operation( - summary = "Create (propose) structures by list of structure elements", - description = "Create (propose) structures by list of structure elements. " + summary = "Create (propose) structures by array of structure elements", + description = "Create (propose) structures by array of structure elements. " + "Return array of created structure elements (proposals)." + "\n\n" + "Structure element attributes required: \n" @@ -181,10 +182,10 @@ public interface IStructures { @Operation( summary = "Find valid structures (search)", description = "Find valid structures (search). " - + "Return list of structure elements." + + "Return paged array of structure elements." ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Return array of structure elements.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponsePageStructureElements.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))) }) @@ -196,7 +197,7 @@ public interface IStructures { public ResponsePageStructureElements readStructures( @Parameter(in = ParameterIn.PATH, description = "type of structure to search in") @PathVariable("type") Type type, @Parameter(in = ParameterIn.QUERY, description = "statuses of structures to search for") @RequestParam(required = false) Status[] statuses, - @Parameter(in = ParameterIn.QUERY, description = "if deleted-only names are to be included, false for non-deleted-only names, true for deleted-only names, not used for both cases") @RequestParam(required = false) Boolean deleted, + @Parameter(in = ParameterIn.QUERY, description = "if deleted structures are to be included or not, omitted for both deleted and not deleted structures") @RequestParam(required = false) Boolean deleted, @Parameter(in = ParameterIn.QUERY, description = "search fields") @RequestParam(required = false) FieldStructure[] queryFields, @Parameter(in = ParameterIn.QUERY, description = "search values corresponding to search fields") @RequestParam(required = false) String[] queryValues, @Parameter(in = ParameterIn.QUERY, description = "order by field") @RequestParam(required = false) FieldStructure orderBy, @@ -218,10 +219,11 @@ public interface IStructures { */ @Operation( summary = "Find valid children structures by type and parent uuid (exact match)", - description = "Find valid children structures by type and parent uuid (exact match)." - ) + description = "Find valid children structures by type and parent uuid (exact match). " + + "Return paged array of structure elements." +) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Return array of structure elements.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponsePageStructureElements.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))) }) @@ -252,10 +254,10 @@ public interface IStructures { @Operation( summary = "Find valid structures by mnemonic (search)", description = "Find valid structures by mnemonic (search). " - + "Return list of structure elements." + + "Return paged array of structure elements." ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Return array of structure elements.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponsePageStructureElements.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))) }) @@ -285,10 +287,10 @@ public interface IStructures { @Operation( summary = "Find valid structures by mnemonic path (search)", description = "Find valid structures by mnemonic path (search). " - + "Return list of structure elements." + + "Return paged array of structure elements." ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Return array of structure elements.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponsePageStructureElements.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))) }) @@ -319,10 +321,10 @@ public interface IStructures { @Operation( summary = "Find history for structure by uuid (exact match)", description = "Find history for structure by uuid (exact match). " - + "Return list of structure elements." + + "Return paged array of structure elements." ) @ApiResponses(value = { - @ApiResponse(responseCode = "200", description = "Method completed OK. Return array of structure elements.", content = @Content(mediaType = "application/json", schema = @Schema(implementation = ResponsePageStructureElements.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))) }) @@ -709,8 +711,8 @@ public interface IStructures { * @return list of structure elements for updated structures (proposals) */ @Operation( - summary = "Update (propose) structures by list of structure elements", - description = "Update (propose) structures by list of structure elements. " + summary = "Update (propose) structures by array of structure elements", + description = "Update (propose) structures by array of structure elements. " + "Return array of updated structure elements (proposals)." + "\n\n" + "Structure element attributes required: \n" @@ -743,8 +745,8 @@ public interface IStructures { * @return list of structure elements for deleted structures (proposals) */ @Operation( - summary = "Delete (propose) structures by list of structure elements", - description = "Delete (propose) structures by list of structure elements. " + summary = "Delete (propose) structures by array of structure elements", + description = "Delete (propose) structures by array of structure elements. " + "Return array of deleted structure elements (proposals)." + "\n\n" + "Structure element attributes required: \n" @@ -777,9 +779,9 @@ public interface IStructures { * @return list of structure elements for approved structures */ @Operation( - summary = "Approve structures (proposals) by list of structure elements", - description = "Approve structures (proposals) by list of structure elements. " - + "Return list of approved structure elements." + summary = "Approve structures (proposals) by array of structure elements", + description = "Approve structures (proposals) by array of structure elements. " + + "Return array of approved structure elements." ) @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)))), @@ -802,9 +804,9 @@ public interface IStructures { * @return list of structure elements for cancelled structures */ @Operation( - summary = "Cancel structures (proposals) by list of structure elements", - description = "Cancel structures (proposals) by list of structure elements. " - + "Return list of cancelled structure elements." + summary = "Cancel structures (proposals) by array of structure elements", + description = "Cancel structures (proposals) by array of structure elements. " + + "Return array of cancelled structure elements." ) @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)))), @@ -827,9 +829,9 @@ public interface IStructures { * @return list of structure elements for rejected structures */ @Operation( - summary = "Reject structures (proposals) by list of structure elements", - description = "Reject structures (proposals) by list of structure elements. " - + "Return list of rejected structure elements." + summary = "Reject structures (proposals) by array of structure elements", + description = "Reject structures (proposals) by array of structure elements. " + + "Return array of rejected structure elements." ) @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)))),