You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix#19, cleanup of MappingService and controller code, harmonization of responses and their documentation, improved determination of result type and including this into the response to the client, fixed tests according to all changes
Copy file name to clipboardExpand all lines: src/main/java/edu/kit/datamanager/mappingservice/rest/IMappingAdministrationController.java
+11-9Lines changed: 11 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -53,16 +53,17 @@ public interface IMappingAdministrationController {
53
53
+ "the mapping identifier and mapping type, and the mapping document, which defines the rules for the mapping applied by the given mapping type. ",
54
54
responses = {
55
55
@ApiResponse(responseCode = "201", description = "CREATED is returned only if the record has been validated, persisted and the mapping document was successfully validated and stored.", content = @Content(schema = @Schema(implementation = MappingRecord.class))),
56
-
@ApiResponse(responseCode = "400", description = "BAD_REQUEST is returned if the provided mapping record or the mapping document is invalid."),
57
-
@ApiResponse(responseCode = "409", description = "CONFLICT is returned, if there is already a mapping for the provided mapping id.")})
56
+
@ApiResponse(responseCode = "400", description = "BAD_REQUEST is returned if the provided mapping record or the mapping document are invalid."),
57
+
@ApiResponse(responseCode = "409", description = "CONFLICT is returned, if there is already a mapping for the provided mapping id."),
58
+
@ApiResponse(responseCode = "500", description = "INTERNAL_SERVER_ERROR is returned, an unexpected exception occured while persisting the mapping.")})
@Parameter(description = "JSON representation of the mapping record.", required = true) @RequestPart(name = "record") finalMultipartFilerecord,
63
64
@Parameter(description = "The mapping document associated with the record. "
64
65
+ "The format of the document is defined by the mapping type, which is given by the mappingType attribute of the mapping record.", required = true) @RequestPart(name = "document") finalMultipartFiledocument,
@Operation(summary = "Get the mapping document associated with a given mapping identifier.", description = "Obtain a single mapping document identified by the mapping identifier. "
83
83
+ "Depending on a user's role, accessing a specific record may be allowed or forbidden. ",
84
84
responses = {
85
-
@ApiResponse(responseCode = "200", description = "OK and the mapping document are returned if the mapping exists and the user has sufficient permission."),
86
-
@ApiResponse(responseCode = "404", description = "NOT_FOUND is returned, if no record for the provided identifier was found.")})
85
+
@ApiResponse(responseCode = "200", description = "OK and the mapping document are returned if the mapping exists and the user has sufficient permission.", content = @Content(schema = @Schema(implementation = MappingRecord.class))),
86
+
@ApiResponse(responseCode = "404", description = "NOT_FOUND is returned, if no record for the provided identifier was found."),
87
+
@ApiResponse(responseCode = "500", description = "INTERNAL_SERVER_ERROR is returned, if the mapping document could not be read from the local file system.")})
@Operation(summary = "Update a mapping record.", description = "Apply an update to the mapping record and/or the mapping document identified by provided identifier and/or its ",
111
112
responses = {
112
113
@ApiResponse(responseCode = "200", description = "OK is returned in case of a successful update, e.g. the record (if provided) was in the correct format and the document (if provided) matches the provided schema id. The updated record is returned in the response.", content = @Content(schema = @Schema(implementation = MappingRecord.class))),
113
-
@ApiResponse(responseCode = "400", description = "BAD_REQUEST is returned if the provided metadata record is invalid or if the validation using the provided schema failed."),
114
-
@ApiResponse(responseCode = "404", description = "NOT_FOUND is returned if no record for the provided identifier was found.")})
114
+
@ApiResponse(responseCode = "400", description = "BAD_REQUEST is returned if the provided mapping record is invalid."),
115
+
@ApiResponse(responseCode = "404", description = "NOT_FOUND is returned if no record for the provided identifier was found."),
116
+
@ApiResponse(responseCode = "500", description = "INTERNAL_SERVER_ERROR is returned if the mapping could not be persisted for unknown reasons.")})
@Parameter(name = "If-Match", description = "ETag of the current mapping record. Please use quotation marks!", required = true, in = ParameterIn.HEADER)})
@ApiResponse(responseCode = "401", description = "UNAUTHORIZED is returned if authorization in required but was not provided."),
43
-
@ApiResponse(responseCode = "403", description = "FORBIDDEN is returned if the caller has no sufficient privileges.")})
38
+
@ApiResponse(responseCode = "401", description = "UNAUTHORIZED is returned if authorization in required but was not provided."),
39
+
@ApiResponse(responseCode = "403", description = "FORBIDDEN is returned if the caller has no sufficient privileges.")})
44
40
publicinterfaceIMappingExecutionController {
45
41
46
-
@Operation(summary = "Map a document with an existing mapping.", description = "This endpoint allows the mapping of documents via a file upload. " +
47
-
"The prerequisite for this is a mapping that has already been created in advance via the \"/api/v1/mapping\" endpoint or the GUI. " +
48
-
"The identifier of this mapping must then be passed to this endpoint as parameters together with the document to be mapped.", responses = {
49
-
@ApiResponse(responseCode = "200", description = "OK is returned if the mapping was successful. " +
50
-
"The result will also be returned in the response.", content = @Content(schema = @Schema(implementation = MappingRecord.class))),
51
-
@ApiResponse(responseCode = "404", description = "NOT_FOUND is returned if no mapping for mappingID could be found."),
52
-
@ApiResponse(responseCode = "400", description = "BAD_REQUEST is returned if a parameter is missing or the mapping could not be performed with the provided input. It is "
53
-
+ "expected that a mapping plugin accepts a well defined input and produces results for proper inputs. Therefore, only a faulty input "
54
-
+ "document should be the reason for a mapper to fail."),
55
-
@ApiResponse(responseCode = "500", description = "INTERNAL_SERVER_ERROR is returned the mapping returned successfully, but the mapping result "
56
-
+ "is not accessible. This is expected to be an error in the mapping implementation and should be fixed in there.")})
42
+
@Operation(summary = "Map a document with an existing mapping.", description = "This endpoint allows the mapping of documents via a file upload. "
43
+
+ "The prerequisite for this is a mapping that has already been created in advance via the \"/api/v1/mappingAdministration\" endpoint or the GUI. "
44
+
+ "The identifier of this mapping must then be passed to this endpoint as parameters together with the document to be mapped.", responses = {
45
+
@ApiResponse(responseCode = "200", description = "OK is returned if the mapping was successful. "
46
+
+ "The result will also be returned in the response."),
47
+
@ApiResponse(responseCode = "404", description = "NOT_FOUND is returned if no mapping for mappingID could be found."),
48
+
@ApiResponse(responseCode = "400", description = "BAD_REQUEST is returned if a parameter is missing or the mapping could not be performed with the provided input. It is "
49
+
+ "expected that a mapping plugin accepts a well defined input and produces results for proper inputs. Therefore, only a faulty input "
50
+
+ "document should be the reason for a mapper to fail."),
51
+
@ApiResponse(responseCode = "500", description = "INTERNAL_SERVER_ERROR is returned the mapping returned successfully, but the mapping result "
52
+
+ "is not accessible. This is expected to be an error in the mapping implementation and should be fixed in there.")})
0 commit comments