Skip to content

13.0.0: SyntaxError: Property or signature expected. (2566:1) #551

Open
@bagbag

Description

@bagbag

Command: swagger-typescript-api --extract-enums --no-client --path https://raw.githubusercontent.com/europace/baufismart-kundenangaben-api/master/kundenangaben-openapi.yaml --name kundenangaben-api.model.ts

Worked with 12.0, but not throws an error with 13.0.

Log:

✨   swagger-typescript-api(13.0.0),npm/9.7.2 node/v20.4.0 linux x64 workspaces/false,debug mode DISABLED
✨   Code generator will use the default template for "api"
✨   Code generator will use the default template for "route types"
✨   try to get swagger by URL "https://raw.githubusercontent.com/europace/baufismart-kundenangaben-api/master/kundenangaben-openapi.yaml"
⭐   start generating your typescript api
SyntaxError: Property or signature expected. (2566:1)
  2564 |
  2565 |      type BaseArbeitserlaubnisTypeMapping<Key,Type> = {
> 2566 | @type: Key
       | ^
  2567 | } & Type
  2568 |
  2569 |   /** Mögliche Typen: Visum, Aufenthaltserlaubnis, Niederlassungserlaubnis, DaueraufenthaltEu */
    at oK (file:///root/.npm/_npx/ad2f6472e51cc62f/node_modules/prettier/plugins/typescript.mjs:25:524)
    at jK (file:///root/.npm/_npx/ad2f6472e51cc62f/node_modules/prettier/plugins/typescript.mjs:27:19264)
    at Object.qK [as parse] (file:///root/.npm/_npx/ad2f6472e51cc62f/node_modules/prettier/plugins/typescript.mjs:27:19628)
    at parse (file:///root/.npm/_npx/ad2f6472e51cc62f/node_modules/prettier/index.mjs:17080:24)
    at async coreFormat (file:///root/.npm/_npx/ad2f6472e51cc62f/node_modules/prettier/index.mjs:18401:7)
    at async formatWithCursor (file:///root/.npm/_npx/ad2f6472e51cc62f/node_modules/prettier/index.mjs:18603:14)
    at async Module.format2 (file:///root/.npm/_npx/ad2f6472e51cc62f/node_modules/prettier/index.mjs:21789:25)
    at async CodeFormatter.prettierFormat (/root/.npm/_npx/ad2f6472e51cc62f/node_modules/swagger-typescript-api/src/code-formatter.js:45:23)
    at async CodeFormatter.formatCode (/root/.npm/_npx/ad2f6472e51cc62f/node_modules/swagger-typescript-api/src/code-formatter.js:60:14)
    at async CodeGenProcess.createOutputFileInfo (/root/.npm/_npx/ad2f6472e51cc62f/node_modules/swagger-typescript-api/src/code-gen-process.js:519:22) {
  loc: { start: { line: 2566, column: 1 } },
  cause: c1: Property or signature expected.
      at ZB (file:///root/.npm/_npx/ad2f6472e51cc62f/node_modules/prettier/plugins/typescript.mjs:21:107127)
      at iU (file:///root/.npm/_npx/ad2f6472e51cc62f/node_modules/prettier/plugins/typescript.mjs:21:108630)
      at vH (file:///root/.npm/_npx/ad2f6472e51cc62f/node_modules/prettier/plugins/typescript.mjs:23:25372)
      at jE (file:///root/.npm/_npx/ad2f6472e51cc62f/node_modules/prettier/plugins/typescript.mjs:23:33451)
      at rK (file:///root/.npm/_npx/ad2f6472e51cc62f/node_modules/prettier/plugins/typescript.mjs:23:33589)
      at file:///root/.npm/_npx/ad2f6472e51cc62f/node_modules/prettier/plugins/typescript.mjs:27:19594
      at sK (file:///root/.npm/_npx/ad2f6472e51cc62f/node_modules/prettier/plugins/typescript.mjs:25:678)
      at Object.qK [as parse] (file:///root/.npm/_npx/ad2f6472e51cc62f/node_modules/prettier/plugins/typescript.mjs:27:19554)
      at parse (file:///root/.npm/_npx/ad2f6472e51cc62f/node_modules/prettier/index.mjs:17080:24)
      at async coreFormat (file:///root/.npm/_npx/ad2f6472e51cc62f/node_modules/prettier/index.mjs:18401:7) {
    fileName: 'estree.ts',
    index: 100398,
    lineNumber: 2566,
    column: 0
  },
  codeFrame: '\x1B[0m \x1B[90m 2564 |\x1B[39m\x1B[0m\n' +
    '\x1B[0m \x1B[90m 2565 |\x1B[39m      type \x1B[33mBaseArbeitserlaubnisTypeMapping\x1B[39m\x1B[33m<\x1B[39m\x1B[33mKey\x1B[39m\x1B[33m,\x1B[39m\x1B[33mType\x1B[39m\x1B[33m>\x1B[39m \x1B[33m=\x1B[39m {\x1B[0m\n' +
    '\x1B[0m\x1B[31m\x1B[1m>\x1B[22m\x1B[39m\x1B[90m 2566 |\x1B[39m \x1B[33m@\x1B[39mtype\x1B[33m:\x1B[39m \x1B[33mKey\x1B[39m\x1B[0m\n' +
    '\x1B[0m \x1B[90m      |\x1B[39m \x1B[31m\x1B[1m^\x1B[22m\x1B[39m\x1B[0m\n' +
    '\x1B[0m \x1B[90m 2567 |\x1B[39m } \x1B[33m&\x1B[39m \x1B[33mType\x1B[39m\x1B[0m\n' +
    '\x1B[0m \x1B[90m 2568 |\x1B[39m\x1B[0m\n' +
    '\x1B[0m \x1B[90m 2569 |\x1B[39m   \x1B[90m/** Mögliche Typen: Visum, Aufenthaltserlaubnis, Niederlassungserlaubnis, DaueraufenthaltEu */\x1B[39m\x1B[0m'
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions