karate : Complex JSON Schema matching , is it ok the validation schema of the responsebody?

36 Views Asked by At
{
"id": 5,
"category": {
    "id": 0,
    "name": "string"
},
"name": "doggie",
"photoUrls": [
    "string"
],
"tags": [
    {
        "id": 0,
        "name": "string"
    }
],
"status": "string"

} Scenario: * def json = """ { "id": 5, "category": { "id": 0, "name": "string" }, "name": "doggie", "photoUrls": [ "string" ], "tags": [ { "id": 0, "name": "string" } ], "status": "string" } """

* def tags = { id: '#integer', name: '#string'}
* def photoUrls = { string: '#string' }
* def category = { id: '#integer',name: '#string'}


* def MYinternalDetails =
"""
  {
    id: '#string',
    name: '#string'
    status: '#string'
    textfield: '##[] textfield',
    tags: '##[] tags',
    photoUrls: '##[] photoUrls',
    category: '##{} category',


  }
"""
* match json == '#[] MYinternalDetails'

enter image description here

0

There are 0 best solutions below