I'm writing my API documentation to swagger.io and I have a problem. I don't know how to documente my array in yaml.
My array (it's JSON) :
The array "answers" have 2 level :
- Level 1: key "24" : correspond to "question_id"
- Level 2: [35,37] : correspond to a list of answers
I hope you understood me.
Thank you for your help.
The OpenAPI specification does not allow you to add constaints to arbitrarily defined keys. To describe 'answers' you can go with:
The definition about says that 'answers' is an object that can have any key, and the value of that key must be an array of integers.
Ok I see.
I think it's not that.. I found an alternative like :
description: La clé "question_id" du tableau correspond à l'ID de la question.