swagger-api / swagger-node

Swagger module for node.js
http://swagger.io
Apache License 2.0
3.97k stars 585 forks source link

swagger project edit cannot get / #581

Open mohitmutha opened 5 years ago

mohitmutha commented 5 years ago

Running swagger version 0.7.5

Steps to reproduce

  1. Create a new project with swagger project create profiles
  2. Select express as the framework
  3. Project is created successfully
  4. Run swagger project edit profiles
  5. Browser page opens up with message Cannot GET /

Other way to reproduce After step 3

  1. Run command cd profiles to browse into the project dir
  2. Run swagger project edit
  3. Browser page opens up with message Cannot GET /
mohitmutha commented 5 years ago

Have tried to install the swagger-editor both locally in the project and globally but getting the same result as above.

MasaakiYAMADA commented 5 years ago

Since there is no swagger-editor, an error may be occurring. Please install it globally and try it.

nom - g install swagger-editor

or

yarn global add swagger-editor

mohitmutha commented 5 years ago

I have already tried adding the swagger-editor locally as well as globally. Still getting the same error.

MasaakiYAMADA commented 5 years ago

Windows users

For some versions of npm on Windows will have problems on the npm install step of swagger project create. They are related to a debug module on npm not being managed properly. The following steps should resolve this issue:

  1. In the project directory, execute the following commands:
    1. npm install yamljs
    2. npm install debug
    3. npm install swagger-tools
MasaakiYAMADA commented 5 years ago

There is also a way to edit YAML with provided docker.

docker run --rm - d - p 80: 8080 swaggerapi / swagger - editor

This image also comes with the swagger-codegen function. I gave up on building locally because desired JAVASE8 in the setting of swagger-codegen.

mwallnoefer commented 5 years ago

I faced the same issue, the problem is that config/default.yaml doesn't contain the item - swagger_params_parser under the section swagger_controllers:. Adding it there fixed the issue for me.

mwallnoefer commented 5 years ago

It turns out that the current node release 0.7.5 doesn't provide the following patch https://github.com/swagger-api/swagger-node/commit/70846a69f76a9a6acbea404bccec36a8d642d387#diff-28fe2e29ccfb9685861115a451ee1626 yet, although it is two years old. Very odd...all in all manual patching seems to be the only work-around for now.

Also the docs lack this line, so I have created an apposite pull request: https://github.com/swagger-api/swagger-node/pull/582

mohitmutha commented 5 years ago
3\. npm install debug

This did not work for me. I am using a Mac

mohitmutha commented 5 years ago

I faced the same issue, the problem is that config/default.yaml doesn't contain the item - swagger_params_parser under the section swagger_controllers:. Adding it there fixed the issue for me.

Did not fix it for me.

mohitmutha commented 5 years ago

Is this project maintained anymore ?

mwallnoefer commented 4 years ago

Any news on this?

JaimeSalas commented 3 years ago

Hi I face this issue. In my case I have solved by installing node v8.17.0 via nvm. I hope can help any one.

lena-A-Al commented 2 years ago

I still have the same issue, I am a mac user.