Closed Madd0g closed 7 years ago
Sorry for the lengthy delay in responding to this.
Yes, the Stack Overflow answer you cited is a good way of handling this in JSDoc. You can also use @param {Array<{name: string, email: string}>} users
(note the spaces), which gives you this parse result from Catharsis:
{
"type": "TypeApplication",
"expression": {
"type": "NameExpression",
"name": "Array"
},
"applications": [
{
"type": "RecordType",
"fields": [
{
"type": "FieldType",
"key": {
"type": "NameExpression",
"name": "name"
},
"value": {
"type": "NameExpression",
"name": "string"
}
},
{
"type": "FieldType",
"key": {
"type": "NameExpression",
"name": "email"
},
"value": {
"type": "NameExpression",
"name": "string"
}
}
]
}
]
}
I found this on stack overflow, but it doesn't work:
I tried this, and it works:
it returns this in
applications
:Is that the recommended way to document nested objects? Or is there something that would further parse the email/string and name/string combinations into their own properties?
EDIT: this stackoverflow answer suggests doing it like this:
Thanks!