Closed RajatKumarChahar closed 1 year ago
Do you perhaps have multiple usages of create_response also in another services? These names have to be unique in the whole specification.
Yes, it's unique. This is happening to all the API's doc. Whenever there is an array its always shows as ["string"]
Now I've used
return {
[model]: modelSchema,
[`${model}_list`]: {
title: `${modelName} list`,
type: "array",
items: { $ref: `#/components/schemas/${model}` },
},
};
above code to generate the definitions but still in every [${model}_list
] it shows [string]
Could you post the generated swagger specification json? (You can use the docsJsonPath option, if you have not enabled it yet) (You can also test it yourself in https://editor.swagger.io/ what the problem is)
This is my doc of a service
On swagger UI the response body is displayed as
I am not sure why it's happening. Can anyone help