Rewrite using returnValues

This commit is contained in:
Philipp Theyssen 2023-02-28 12:13:55 +01:00
parent a334e02149
commit 30936ad638
2 changed files with 130 additions and 22 deletions

View File

@ -11,19 +11,79 @@
"returnValues": [ "returnValues": [
{ {
"key": "item-1", "key": "item-1",
"value": "@@response.payload.data[0]@@", "value": "response.payload.data[0]",
"type": "object" "type": "object"
}, },
{
"key": "item-1-id",
"value": "response.payload.data[0].id",
"type": "string"
},
{
"key": "item-1-name",
"value": "response.payload.data[0].name",
"type": "string"
},
{
"key": "item-1-price",
"value": "response.payload.data[0].price",
"type": "unsignedInt"
},
{
"key": "item-1-avialable-stock",
"value": "response.payload.data[0].availablestock",
"type": "unsignedInt"
},
{ {
"key": "item-2", "key": "item-2",
"value": "@@response.payload.data[1]@@", "value": "response.payload.data[1]",
"type": "object" "type": "object"
}, },
{
"key": "item-2-id",
"value": "response.payload.data[1].id",
"type": "string"
},
{
"key": "item-2-name",
"value": "response.payload.data[1].name",
"type": "string"
},
{
"key": "item-2-price",
"value": "response.payload.data[1].price",
"type": "unsignedInt"
},
{
"key": "item-2-avialable-stock",
"value": "response.payload.data[1].availablestock",
"type": "unsignedInt"
},
{ {
"key": "item-3", "key": "item-3",
"value": "@@response.payload.data[2]@@", "value": "response.payload.data[2]",
"type": "object" "type": "object"
} }
{
"key": "item-3-id",
"value": "response.payload.data[2].id",
"type": "string"
},
{
"key": "item-3-name",
"value": "response.payload.data[2].name",
"type": "string"
},
{
"key": "item-3-price",
"value": "response.payload.data[2].price",
"type": "unsignedInt"
},
{
"key": "item-3-avialable-stock",
"value": "response.payload.data[2].availablestock",
"type": "unsignedInt"
},
] ]
"url": "http://localhost:5101/catalog-api/api/v1/Catalog/items" "url": "http://localhost:5101/catalog-api/api/v1/Catalog/items"
} }

View File

@ -5,7 +5,55 @@
{ {
"name": "user-id", "name": "user-id",
"type": "guid" "type": "guid"
} },
{
"name": "item-1-id",
"type": "string"
},
{
"name": "item-1-name",
"type": "string"
},
{
"name": "item-1-price",
"type": "unsignedInt"
},
{
"name": "item-1-available-stock",
"type": "unsignedInt"
},
{
"name": "item-2-id",
"type": "string"
},
{
"name": "item-2-name",
"type": "string"
},
{
"name": "item-2-price",
"type": "unsignedInt"
},
{
"name": "item-2-available-stock",
"type": "unsignedInt"
},
{
"name": "item-3-id",
"type": "string"
},
{
"name": "item-3-name",
"type": "string"
},
{
"name": "item-3-price",
"type": "unsignedInt"
},
{
"name": "item-3-available-stock",
"type": "unsignedInt"
},
], ],
"operations": [ "operations": [
{ {
@ -25,37 +73,37 @@
"value": "value":
{ {
"id": "1", "id": "1",
"productId": "@@op-1.response[0].id@@", "productId": "{{item-1-id}}",
"productName": "@@op-1.response[0].name@@", "productName": "{{item-1-name}}",
"unitPrice": "@@op-1.response[0].price@@", "unitPrice": "{{item-1-price}}",
"oldUnitPrice": "@@op-1.response[0].price@@", "oldUnitPrice": "{{item-1-price}}",
"quantity": "@@op-1.response[0].availablestock@@", "quantity": "{{item-1-available-stock}}",
"pictureUrl": "" "pictureUrl": ""
}, },
}, },
{ {
"key": "item-2", "key": "item-2",
"value": "value":
{ {
"id": "2", "id": "2",
"productId": "@@op-1.response[1].id@@", "productId": "{{item-2-id}}",
"productName": "@@op-1.response[1].name@@", "productName": "{{item-2-name}}",
"unitPrice": "@@op-1.response[1].price@@", "unitPrice": "{{item-2-price}}",
"oldUnitPrice": "@@op-1.response[1].price@@", "oldUnitPrice": "{{item-2-price}}",
"quantity": "@@op-1.response[1].availablestock@@", "quantity": "{{item-2-available-stock}}",
"pictureUrl": "" "pictureUrl": ""
}, },
}, },
{ {
"key": "item-3", "key": "item-3",
"value": "value":
{ {
"id": "3", "id": "3",
"productId": "@@op-1.response[2].id@@", "productId": "{{item-3-id}}",
"productName": "@@op-1.response[2].name@@", "productName": "{{item-3-name}}",
"unitPrice": "@@op-1.response[2].price@@", "unitPrice": "{{item-3-price}}",
"oldUnitPrice": "@@op-1.response[2].price@@", "oldUnitPrice": "{{item-3-price}}",
"quantity": "@@op-1.response[2].availablestock@@", "quantity": "{{item-3-available-stock}}",
"pictureUrl": "" "pictureUrl": ""
} }
} }