OpenAPITools / OpenAPITools/openapi-generator

[BUG] version 4.0.0.beta3 fails to start the nodejs-server generated code

Open
#2,855 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug Server: Nodejs
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

  • Install NVM, npm 6.9.0, and openapi-generator 4.0.0.beta3
  • downlaod petstore.yaml and validate uding the validate command
  • generate a nodejs-server using npx openapi-generator generate -i temp/node/petstore.yaml -g nodejs-server -o temp/node/out
  • cd temp/node/out
  • npm start
    This command fails reporting:
    /home/javadch/temp/node/out/node_modules/swagger-tools/lib/helpers.js:169 throw new Error('Unsupported Swagger version: ' + version); ^ Error: Unsupported Swagger version: undefined

OpenAPITools uses apigee, which says it supports swagger 1 and 2 only, while OpenAPITools support 3 too.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the generated nodejs-server output and node_modules/swagger-tools/lib/helpers.js, using petstore.yaml and the reported npm start command to reproduce the failure. Check how the generated server passes the OpenAPI version to swagger-tools and determine what is required for the OpenAPI 3 input to start without the unsupported-version error.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs, openapi
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.