Closed juicycool92 closed 1 year ago
I also found this issue. This might be worked around but for me, it works fine. instead of import type def like that. I added it in filesPattern in swagger_options like this
const swagger_options = {
info: {
version: '1.0.0',
title: 'API',
license: {
name: 'MIT',
},
},
security: {},
filesPattern: [ './typedef.ts', './*.js' ], // Glob pattern to find your jsdoc files
swaggerUIPath: `/swagger`, // SwaggerUI will be render in this url. Default: '/api-docs'
baseDir: __dirname,
exposeSwaggerUI: true, // Expose OpenAPI UI. Default true
exposeApiDocs: true, // Expose Open API JSON Docs documentation in `apiDocsPath` path. Default false.
apiDocsPath: '/v3/api-docs', // Open API JSON Docs endpoint. Default value '/v3/api-docs'.
};
I also found this issue. This might be worked around but for me, it works fine. instead of import type def like that. I added it in filesPattern in swagger_options like this
const swagger_options = { info: { version: '1.0.0', title: 'API', license: { name: 'MIT', }, }, security: {}, filesPattern: [ './typedef.ts', './*.js' ], // Glob pattern to find your jsdoc files swaggerUIPath: `/swagger`, // SwaggerUI will be render in this url. Default: '/api-docs' baseDir: __dirname, exposeSwaggerUI: true, // Expose OpenAPI UI. Default true exposeApiDocs: true, // Expose Open API JSON Docs documentation in `apiDocsPath` path. Default false. apiDocsPath: '/v3/api-docs', // Open API JSON Docs endpoint. Default value '/v3/api-docs'. };
yeah, its works indeed!
I was totally forgot about this threads, im sorry for late response. 🤣 Thankyou for your kind answer!
Is your feature request related to a problem? Please describe.
I love to use express-jsdoc-swagger. but recently, I replace my server to typescripts and have a problems. since back js code, I wrap my code with babel, but after change to ts, I think I don't need babel in my case, and i removed it. ( this is my guess why js codes are working fine but not ts )
soon I realized that there was error on swagger page. its failed to recognize my
@typedef
so I ran tests. results are in bottom.Describe the solution you'd like it will be great to import
@typedef
like jsdoc. like thisor just import typedef files onto root, and recognize any child files.
Describe alternatives you've considered my point is : there is ton of exactly same typedefs are in use on my app. but I don't like declare typedef every files top.
if there is any other solutions available, please let me know.
Additional context
this is sample test run codes.
reslut
add separate file which contains
@typedef
only.result