RED-10260: add quote char to component mapping
This commit is contained in:
parent
3fe009512f
commit
0ad3973d23
@ -509,7 +509,7 @@ paths:
|
|||||||
- **Optimization Tip:** Place keys to be queried in the first columns and the results to be mapped in the last column for best performance.
|
- **Optimization Tip:** Place keys to be queried in the first columns and the results to be mapped in the last column for best performance.
|
||||||
|
|
||||||
#### Customization Options
|
#### Customization Options
|
||||||
- Users can specify the delimiter and encoding used in the CSV file.
|
- Users can specify the delimiter, quoteChar, and encoding used in the CSV file.
|
||||||
|
|
||||||
#### Usage
|
#### Usage
|
||||||
- The component mapping file can be utilized in component rules to relate components to existing master data.
|
- The component mapping file can be utilized in component rules to relate components to existing master data.
|
||||||
@ -533,6 +533,7 @@ paths:
|
|||||||
- $ref: '#/components/parameters/mappingName'
|
- $ref: '#/components/parameters/mappingName'
|
||||||
- $ref: '#/components/parameters/encoding'
|
- $ref: '#/components/parameters/encoding'
|
||||||
- $ref: '#/components/parameters/delimiter'
|
- $ref: '#/components/parameters/delimiter'
|
||||||
|
- $ref: '#/components/parameters/quoteChar'
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
content:
|
content:
|
||||||
@ -609,7 +610,7 @@ paths:
|
|||||||
- **Optimization Tip:** Place keys to be queried in the first columns and the results to be mapped in the last column for best performance.
|
- **Optimization Tip:** Place keys to be queried in the first columns and the results to be mapped in the last column for best performance.
|
||||||
|
|
||||||
#### Customization Options
|
#### Customization Options
|
||||||
- Users can specify the delimiter and encoding used in the CSV file.
|
- Users can specify the delimiter, quoteChar, and encoding used in the CSV file.
|
||||||
tags:
|
tags:
|
||||||
- 1. Dossier Templates
|
- 1. Dossier Templates
|
||||||
requestBody:
|
requestBody:
|
||||||
@ -623,6 +624,7 @@ paths:
|
|||||||
- $ref: '#/components/parameters/mappingName'
|
- $ref: '#/components/parameters/mappingName'
|
||||||
- $ref: '#/components/parameters/encoding'
|
- $ref: '#/components/parameters/encoding'
|
||||||
- $ref: '#/components/parameters/delimiter'
|
- $ref: '#/components/parameters/delimiter'
|
||||||
|
- $ref: '#/components/parameters/quoteChar'
|
||||||
responses:
|
responses:
|
||||||
"200":
|
"200":
|
||||||
content:
|
content:
|
||||||
@ -2114,6 +2116,17 @@ components:
|
|||||||
example: ','
|
example: ','
|
||||||
default: ','
|
default: ','
|
||||||
description: "The delimiter used as a separator in a csv file."
|
description: "The delimiter used as a separator in a csv file."
|
||||||
|
quoteChar:
|
||||||
|
name: quoteChar
|
||||||
|
required: false
|
||||||
|
in: query
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
minLength: 1
|
||||||
|
maxLength: 1
|
||||||
|
example: '"'
|
||||||
|
default: '"'
|
||||||
|
description: "The quoteChar used to quote fields in a csv file."
|
||||||
mappingName:
|
mappingName:
|
||||||
name: name
|
name: name
|
||||||
required: false
|
required: false
|
||||||
|
|||||||
@ -101,7 +101,7 @@ public class ComponentMappingTest extends AbstractPersistenceServerServiceTest {
|
|||||||
IOUtils.toByteArray(new ClassPathResource("files/componentmapping/empty.csv").getInputStream()));
|
IOUtils.toByteArray(new ClassPathResource("files/componentmapping/empty.csv").getInputStream()));
|
||||||
|
|
||||||
var result = assertThrows(FeignException.class,
|
var result = assertThrows(FeignException.class,
|
||||||
() -> dossierTemplateExternalClient.uploadMapping(dossierTemplate.getId(), mockMultipartFile, "file", "UTF-8", ",", quoteChar));
|
() -> dossierTemplateExternalClient.uploadMapping(dossierTemplate.getId(), mockMultipartFile, "file", "UTF-8", ",", "\""));
|
||||||
assertTrue(result.getMessage().contains("CSV file can not be empty!"));
|
assertTrue(result.getMessage().contains("CSV file can not be empty!"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user