Forum Discussion

Sibqo's avatar
Sibqo
Occasional Contributor
4 years ago
Solved

schema of the responses when response parameters are repeated itself

Hi!

i want to ask about the responses like: If the api returns the list of all the users then in the response there is a list of users and each user having the same parameters like this:

[
{
"id": 1,
"code": "2y1"
},
{
"id": 2,
"code": "2y1"
}
]
 

then in the schema of this response how i can write in the yaml?

i had wriiten it as:

getallUsers:

   properties:

      properties:
         id:
            type: integer
        code:
            type: string

 

if i make the objects and arrays then it shows the error of duplicated key etc. If anyone have any idea kindly guide me

  • If the object has been recreated, then to avoid the error, get the new object before the method call.

     

    Try doing a Get on the page before looking for the elements.