[
{
"id": 8531,
"category": {
"id": 0,
"name": "string"
},
"name": "doggie",
"photoUrls": [
"string"
],
"tags": [
{
"id": 3,
"name": "string"
}
],
"status": "available"
},
{
"id": 9009,
"category": {
"id": 0,
"name": "string"
},
"name": "doggie",
"photoUrls": [
"string"
],
"tags": [
{
"id": 2,
"name": "string"
}
],
"status": "available"
}
]
sourceSystem: "ASD"
destinationSystem: "ASDF"
params:
dateFormat: yyyy-MM-dd'T'HH:mm:ss'Z'
result:
type: array
path: ..../
# filter: $self.index%3==0
xml:
path: "/pets/Pet"
fields:
category:
type: object
fields:
id:
dataType: long
name:
# tagId:
# type: object
# filter: $self.index==3
# path: ../tags
## parentPath: ../tags
# xml:
# path: /pets/Pet/tags/tag
# fields:
# id: int
# name:
#
tagIds:
dataType: long
type: array
path: tags/id
xml:
path: tags/tag/id
id:
dataType: long
name:
status:
photoUrls:
type: array
path: photoUrls
xml:
path: photoUrls/photoUrls
tags:
type: array
path: tags
xml:
path: tags/tag
fields:
id:
dataType: long
name:
@Test
public void parsePet() throws IOException {
Path rootPath = Paths.get(TestUtils.getTestResourcePath(), pathPlace);
DSMBuilder builder = new DSMBuilder(rootPath.resolve("pet.yml").toFile(), rootPath.toString());
DSM dsm = builder.setType(DSMBuilder.TYPE.JSON).create(Pet.class);
File file = rootPath.resolve("pet.json").toFile();
Object object = dsm.toObject(file);
List<Pet> list = (List<Pet>) object;
String s = JSONUtil.toJsonStr(list);
System.out.println(s);
}
[
{
"photoUrls": [
"string"
],
"tagIds": [
3
],
"tags": [
{
"name": "string",
"id": 3
}
],
"name": "doggie",
"id": 8531,
"category": {
"name": "string",
"id": 0
},
"status": "available"
},
{
"photoUrls": [
"string"
],
"tagIds": [
2
],
"tags": [
{
"name": "string",
"id": 2
}
],
"name": "doggie",
"id": 9009,
"category": {
"name": "string",
"id": 0
},
"status": "available"
},
{
"photoUrls": [
"string"
],
"tagIds": [
2
],
"tags": [
{
"name": "string",
"id": 2
}
],
"name": "doggie",
"id": 9009,
"category": {
"name": "string",
"id": 0
},
"status": "available"
}
]
There are two items with the same id "9009". It seems one more data exists.
I researched there is a new version 1.0.5 to fix similar bug. But when I debuged in the code at "case END_ARRAY", found it go to another condition at line 27 as below.
![image](https://private-user-images.githubusercontent.com/43462802/265647627-c0a6232e-75d7-438d-8fb6-143d06600af5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk0NTM3NTcsIm5iZiI6MTcxOTQ1MzQ1NywicGF0aCI6Ii80MzQ2MjgwMi8yNjU2NDc2MjctYzBhNjIzMmUtNzVkNy00MzhkLThmYjYtMTQzZDA2NjAwYWY1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjclMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI3VDAxNTczN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTVjMDNlOTJiZjY3OTU3N2Q1YzEyMDQ2NTQ3MmM5Nzk1ZWNjOTA4NmJkMTkyZWZmNmVhNTk1NGQ2MGJhZWMwOGYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.csnKE7RMbYQ9o1UtqeN1syLmnrq1ZXSht6Exwabbaj0)