My code works ok, but I need help with my documentation in nestjs-asyncapi
and swagger
. In my code, I have an object in the array, but in the documentation I have only an object.
This is my nest js decorator:
@AsyncApiSub({
channel: 'myChannel',
description: 'Read all features - result',
message: {
name: 'getFeaturesResponse',
payload: {
type: () => Feature,
},
headers: AsyncApiHeaders.subHeaders(),
},
})
And now I created this part of my async API in Async API studio and everything looks ok, exactly like I want. But I don't know how should I update the decorator in order to have array
"Feature": {
"type": "array",
"items": {
"type": "object",
"properties": {
"idFeature": {
"type": "string",
"description": "unique id of Feature",
"example": "example"
},
},
},
"required": [
"idFeature",
"name",
"description"
]
},
This is what I want.
Should I provide more information? Should I rewrite somehow the whole decorator or only some parts? Thanks for your help.