swagger-node icon indicating copy to clipboard operation
swagger-node copied to clipboard

swagger project edit cannot get /

Open mohitmutha opened this issue 6 years ago • 13 comments

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 4. Run command cd profiles to browse into the project dir 5. Run swagger project edit 6. Browser page opens up with message Cannot GET /

mohitmutha avatar Feb 10 '19 08:02 mohitmutha

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

mohitmutha avatar Feb 10 '19 08:02 mohitmutha

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

MasaakiYAMADA avatar Feb 12 '19 07:02 MasaakiYAMADA

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

mohitmutha avatar Feb 12 '19 09:02 mohitmutha

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:
  2. npm install yamljs
  3. npm install debug
  4. npm install swagger-tools

MasaakiYAMADA avatar Feb 13 '19 23:02 MasaakiYAMADA

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.

MasaakiYAMADA avatar Feb 14 '19 00:02 MasaakiYAMADA

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 avatar Feb 18 '19 21:02 mwallnoefer

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

mwallnoefer avatar Feb 18 '19 21:02 mwallnoefer

3\. npm install debug

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

mohitmutha avatar Feb 22 '19 13:02 mohitmutha

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 avatar Feb 22 '19 13:02 mohitmutha

Is this project maintained anymore ?

mohitmutha avatar Feb 22 '19 13:02 mohitmutha

Any news on this?

mwallnoefer avatar Jan 29 '20 15:01 mwallnoefer

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.

JaimeSalas avatar Mar 28 '21 18:03 JaimeSalas

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

lena-A-Al avatar Mar 31 '22 02:03 lena-A-Al