Hi all,
I’m trying to validate the response JSON schema in postman which is failing. There are 2 problem areas which I suppose-
In response, there is a dynamic value e.g., SKU319, which schema converter is considering as a property for the array.
The response has multiple similar objects in the array i.e.,-
{
"skuCode": "SKU319",
"location": "AMZ",
"qty": 0.000,
"committedQty": 0.000,
"dedicatedInv": []
},
{
"skuCode": "SKU319",
"location": "BWD",
"qty": 0.000,
"committedQty": 0.000,
"dedicatedInv": []
},
{
"skuCode": "SKU319",
"location": "CAL",
"qty": 0.000,
"committedQty": 0.000,
"dedicatedInv": []
}
The number of times the above objects can appear is not fixed.
Here is the complete response JSON which I need to validate in schema-
{
"responseCode": 0,
"responseMessage": "Success",
"response": {
"totalSkus": "1",
"totalPages": 1,
"currentPage": 1,
"inventoryMap": [
{
"SKU319": [
{
"skuCode": "SKU319",
"location": "AMZ",
"qty": 0.000,
"committedQty": 0.000,
"dedicatedInv": []
},
{
"skuCode": "SKU319",
"location": "BWD",
"qty": 0.000,
"committedQty": 0.000,
"dedicatedInv": []
},
{
"skuCode": "SKU319",
"location": "CAL",
"qty": 0.000,
"committedQty": 0.000,
"dedicatedInv": []
},
{
"skuCode": "SKU319",
"location": "CHE",
"qty": 0.000,
"committedQty": 0.000,
"dedicatedInv": []
},
{
"skuCode": "SKU319",
"location": "DWK",
"qty": 0.000,
"committedQty": 0.000,
"dedicatedInv": []
},
{
"skuCode": "SKU319",
"location": "FAZ",
"qty": 0.000,
"committedQty": 0.000,
"dedicatedInv": []
},
{
"skuCode": "SKU319",
"location": "GUW",
"qty": 0.000,
"committedQty": 0.000,
"dedicatedInv": []
},
{
"skuCode": "SKU319",
"location": "KOL",
"qty": 0.000,
"committedQty": 0.000,
"dedicatedInv": []
},
{
"skuCode": "SKU319",
"location": "S71",
"qty": 0.000,
"committedQty": 0.000,
"dedicatedInv": []
},
{
"skuCode": "SKU319",
"location": "SDP",
"qty": 0.000,
"committedQty": 0.000,
"dedicatedInv": []
},
{
"skuCode": "SKU319",
"location": "SNP",
"qty": 0.000,
"committedQty": 0.000,
"dedicatedInv": []
},
{
"skuCode": "SKU319",
"location": "TRET",
"qty": 0.000,
"committedQty": 0.000,
"dedicatedInv": []
}
]
}
]
}
}
Please help to how to validate this schema. Tried multiple times but still failing. Thanks!