Surnet / swagger-jsdoc

Generates swagger/openapi specification based on jsDoc comments and YAML files.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: s is not a constructor (using DENO)

bjoernwuest opened this issue · comments

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

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.