Forum Discussion

Sona's avatar
Sona
New Contributor
6 years ago

Any simple way to check whether all tags are present or not in json response

I am just looking out a solution for validating all tags are present or not inside my JSON response  based on  my model schema.No need to consider about values for attributes .Since values will get change based on input data.

 

To be more clear, If i have total of  2500 lines of json response including arrays , nested arrays.I need to validate all  tags are present or not based on my Model schema given in swagger.

 

 

Please anyone help me on this.

2 Replies

  • richie's avatar
    richie
    Community Hero
    hi, your final paragraph states that you dont want to validate against the schema. is that realt correct? why would you not want to do that?

    cos thats kindof perfect for what you want rather than having to create thousands of assertions.

    if you were to use a groovy script to validate against a schema that would do the job.

    theres a groovyscript for xml schema validation (support.smartbear.com/readyapi/docs/testing/scripts/samples/xsd-validation.html). you could alter this for json schema validation im guessing.

    cheers,

    richie