RED-8670: integrate table inference from research

* introduce controllerAdvice to ControllerV2 package
This commit is contained in:
Kilian Schuettler 2024-05-23 19:29:21 +02:00
parent cf9b71a96c
commit 92a277b24e
3 changed files with 27 additions and 20 deletions

View File

@ -36,8 +36,8 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@RequiredArgsConstructor
@RestControllerAdvice
@RequiredArgsConstructor
@Order(Ordered.HIGHEST_PRECEDENCE)
public class ExternalControllerAdviceV2 {

View File

@ -141,7 +141,7 @@ public interface DossierTemplateResource {
@ResponseStatus(value = HttpStatus.OK)
@Operation(summary = "Returns file containing the specified mapping as a file.")
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK"), @ApiResponse(responseCode = "404", description = "The DossierTemplate is not found.")})
@GetMapping(value = PATH + DOSSIER_TEMPLATE_ID_PATH_VARIABLE + COMPONENT_MAPPINGS_PATH + COMPONENT_MAPPING_ID_PATH_VARIABLE, produces = MediaType.MULTIPART_FORM_DATA_VALUE)
@GetMapping(value = PATH + DOSSIER_TEMPLATE_ID_PATH_VARIABLE + COMPONENT_MAPPINGS_PATH + COMPONENT_MAPPING_ID_PATH_VARIABLE)
ResponseEntity<?> downloadMapping(@PathVariable(DOSSIER_TEMPLATE_ID_PARAM) String dossierTemplateId, @PathVariable(COMPONENT_MAPPING_ID_PARAM) String componentMappingId);
@ -149,7 +149,7 @@ public interface DossierTemplateResource {
@ResponseStatus(value = HttpStatus.OK)
@Operation(summary = "Deletes a specified mapping.")
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK"), @ApiResponse(responseCode = "404", description = "The DossierTemplate or the specified mapping is not found.")})
@DeleteMapping(value = PATH + DOSSIER_TEMPLATE_ID_PATH_VARIABLE + COMPONENT_MAPPINGS_PATH + COMPONENT_MAPPING_ID_PATH_VARIABLE, produces = MediaType.MULTIPART_FORM_DATA_VALUE)
@DeleteMapping(value = PATH + DOSSIER_TEMPLATE_ID_PATH_VARIABLE + COMPONENT_MAPPINGS_PATH + COMPONENT_MAPPING_ID_PATH_VARIABLE)
ResponseEntity<?> deleteMapping(@PathVariable(DOSSIER_TEMPLATE_ID_PARAM) String dossierTemplateId, @PathVariable(COMPONENT_MAPPING_ID_PARAM) String componentMappingId);
}

View File

@ -315,7 +315,7 @@ paths:
"403":
$ref: '#/components/responses/403'
"404":
$ref: '#/components/responses/404-dossier-template'
$ref: '#/components/responses/404-mapping'
"429":
$ref: '#/components/responses/429'
"500":
@ -357,7 +357,7 @@ paths:
"403":
$ref: '#/components/responses/403'
"404":
$ref: '#/components/responses/404-dossier-template'
$ref: '#/components/responses/404-mapping'
"429":
$ref: '#/components/responses/429'
"500":
@ -382,9 +382,9 @@ paths:
Content-Disposition:
schema:
type: string
example: attachment; filename*=utf-8''mapping.csv
example: attachment; filename*=mapping.csv
content:
text/plain; charset=utf-8:
text/plain:
schema:
type: string
description: |
@ -396,7 +396,7 @@ paths:
"403":
$ref: '#/components/responses/403'
"404":
$ref: '#/components/responses/404-dossier-template'
$ref: '#/components/responses/404-mapping'
"429":
$ref: '#/components/responses/429'
"500":
@ -432,7 +432,7 @@ paths:
"403":
$ref: '#/components/responses/403'
"404":
$ref: '#/components/responses/404-dossier-template'
$ref: '#/components/responses/404-mapping'
"429":
$ref: '#/components/responses/429'
"500":
@ -458,7 +458,7 @@ paths:
"403":
$ref: '#/components/responses/403'
"404":
$ref: '#/components/responses/404-dossier-template'
$ref: '#/components/responses/404-mapping'
"429":
$ref: '#/components/responses/429'
"500":
@ -965,14 +965,14 @@ components:
responses:
"400":
content:
'*/*':
'application/json':
schema:
$ref: '#/components/schemas/ErrorMessage'
description: |
The request was malformed or invalid. Double-check the request structure or parameters.
"401":
content:
'*/*':
'application/json':
schema:
$ref: '#/components/schemas/ErrorMessage'
description: |
@ -980,21 +980,28 @@ components:
resource. This error can happen if the access token was revoked or has expired.
"403":
content:
'*/*':
'application/json':
schema:
$ref: '#/components/schemas/ErrorMessage'
description: |
Forbidden. Your credentials are valid, but you do not have permission to access this resource.
"404-dossier-template":
content:
'*/*':
'application/json':
schema:
$ref: '#/components/schemas/ErrorMessage'
description: |
Dossier template not found. This happens if the requested dossier template does not exist.
"404-mapping":
content:
'application/json':
schema:
$ref: '#/components/schemas/ErrorMessage'
description: |
Dossier template or component mapping not found. This happens if the requested dossier template or component mapping does not exist.
"404-dossier":
content:
'*/*':
'application/json':
schema:
$ref: '#/components/schemas/ErrorMessage'
description: |
@ -1004,7 +1011,7 @@ components:
for a previously existing dossier only if it is actually deleted permanently.
"404-file":
content:
'*/*':
'application/json':
schema:
$ref: '#/components/schemas/ErrorMessage'
description: |
@ -1014,28 +1021,28 @@ components:
only if the file is deleted permanently.
"409-dossier-conflict":
content:
'*/*':
'application/json':
schema:
$ref: '#/components/schemas/ErrorMessage'
description: |
Name conflict: The provided name is already in use by another dossier. It needs to be unique in the scope of your workspace.
422-rules:
content:
'*/*':
'application/json':
schema:
$ref: '#/components/schemas/RuleValidation'
description: |
Invalid rules file: There were validation errors, the rules file is unprocessable.
"429":
content:
'*/*':
'application/json':
schema:
$ref: '#/components/schemas/ErrorMessage'
description: |
Too many requests have been made in a given time frame. Rate limiting is in place to prevent abuse.
"500":
content:
'*/*':
'application/json':
schema:
$ref: '#/components/schemas/ErrorMessage'
description: Internal Server Error. An unexpected error occurred on the server side. Please try again later or contact support.