I am documenting my response models, and need to show the api returns list of string.
["user1","user2"]
but the model requires a dictionary(json) format, as follow:
ns.response(200,'Success', NS.model("my_get_model",[{
"name": fields.String(example="user1"),
}]))
I have tried following codes but none of them work:
ns = Namespace('My Apis')
ns.response(200,'Success', [ns.model("my_get_model",
fields.String(example="user1")
)])
or
ns.response(200,'Success', ["user1"])
or
ns.response(200,'Success', ns.model("my_get_model",fields.List(fields.String(example="user1"))))
Please advice.