How can I add description to the root of Generated Document? #1318
-
I have tried to find the description to pass when create new Docuement object but can't find it anywhere. The document doesn't have it too: https://www.npmjs.com/package/express-zod-api#creating-a-documentation |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The You can set it and any other properties you need to the instance of const documentation = new Documentation({ ... });
documentation.info.description = "Your description here";
console.log( documentation. getSpecAsYaml() ); |
Beta Was this translation helpful? Give feedback.
The
Documentation
class extents theOpenApiBuilder
(3.0) fromopenapi3-ts
library.According to the type of the
OpenApiObject
, top level description that you refer to, is most likely the one located ininfo
object:https://github.com/metadevpro/openapi3-ts/blob/e470c7c7c60b7c75e24e1c824ca49e55d025d9ef/src/model/openapi30.ts#L24
You can set it and any other properties you need to the instance of
Documentation
. Try this, @huyhoang160593 :