Good morning guys,
I need some help with collection runner.
Let me explain with an example
I’m able to send this json via POST method, using the entire json text in the body section. The json is the following
{
"key": "12345",
"datGeo": {
"datSGM": [
{
"geoJson": {
"coordinates": [
[
[
2610974.5659367307,
4256418.13717125
],
[
2610974.5659367307,
4256283.95221125
],
[
2611085.8132967306,
4256282.80533125
],
[
2611093.8414567304,
4256434.193491249
],
[
2610974.5659367307,
4256418.13717125
]
]
],
"type": "Polygon",
"properties": {
"value1": "1",
"value2": "420"
}
}
}
]
},
"datetime": "2020-01-01"
}
Given that I need to send tons of those kind of json, I was hoping to use collection runner but, with collection runner nothing works.
I use collection runner passing the same json written before.
The body of the POST method is this one
{
"datGeo": {
"datSGM": [
{
"geoJson": {
"coordinates": [[{{coordinates}}]],
"type": "{{type}}",
"properties": {
"value1": "{{value1}}",
"value2": "{{value2}}"
}
}
}
]
},
"datetime": "{{datetime}}"
}
The “key” field is a variabile in the POST url.
If I upload the json file, the preview is this
As you can see, Postman is not able to deseriazile the object.
When I try to run this collection, the response is this one
{“error”:“BAD_REQUEST”,“timestamp”:“2024-03-29T10:34:19.074182”,“message”:"DatSGMDto from Array value (token JsonToken.START_ARRAY`)\n at [Source: (org.springframework.util.StreamUtils$NonClosingInputStream);
And my request body is this (only “datetime” is present)
{
"datGeo": {
"datSGM": [
{
"geoJson": {
"coordinates": [[{{coordinates}}]],
"type": "{{type}}",
"properties": {
"value1": "{{value1}}",
"value2": "{{value2}}"
}
}
}
]
},
"datetime": "2020-01-01"
}
Where I’m wrong? Could someone help me please?
Thanks a lot!