Surnet / swagger-jsdoc

Generates swagger/openapi specification based on jsDoc comments and YAML files.
MIT License
1.66k stars 224 forks source link

TypeError: s is not a constructor (using DENO) #384

Closed bjoernwuest closed 6 months ago

bjoernwuest commented 8 months ago

From the code below I receive this error and be quite puzzled how it comes because I am not aware to define/use "s" anywhere.

error: Uncaught (in promise) TypeError: s is not a constructor
    at Module.q.parse (https://esm.sh/v129/@apidevtools/json-schema-ref-parser@9.1.2/denonext/json-schema-ref-parser.mjs:19:6859)
    at j (https://esm.sh/v129/swagger-jsdoc@6.2.8/denonext/swagger-jsdoc.mjs:10:3019)
    at un (https://esm.sh/v129/swagger-jsdoc@6.2.8/denonext/swagger-jsdoc.mjs:22:74)
    at _.exports (https://esm.sh/v129/swagger-jsdoc@6.2.8/denonext/swagger-jsdoc.mjs:22:556)
    at file:///C:/3LOC/ear.backend/src/main.ts:4:30
    at eventLoopTick (ext:core/01_core.js:183:11)

Here is the code that I use (main.ts):

import swaggerJSDoc from "[swagger-jsdoc](https://esm.sh/swagger-jsdoc@6.2.8)";

const opts: swaggerJSDoc.Options = {definition:{openapi: '3.0.0',info:{title:"Test",version:"1.0.0"}}, apis: ["./**/*.ts"]};
const openapiSpecification = swaggerJSDoc(opts);
console.log(openapiSpecification);

And here the file that is (hopefully) processed:

/**
 * @openapi
 * components:
 *   schemas:
 *     Permission:
 *       type: object
 *       properties:
 *         permissionID:
 *           type: string
 *           format: uuid
 *           description: lalalal
 *           example: 00000
 */
export type Permission = {permissionID: string};

I run everything with deno run -A src/main.ts

stale[bot] commented 6 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.