swagger-api / swagger-node

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

swagger editor - Not as full featured as swagger.io editor??? #343

Open barlowm opened 8 years ago

barlowm commented 8 years ago

I'm working through a QuickStart example in swagger-tools, and after creating the simple project to get the API up and running (swagger project create simple), I opened the editor (swagger project edit) and then tried to import the "Simple Weather API" listing that was listed (which is in JSON format) into the editor but can't. There's no options to open or import any file.

I finally managed to get the JSON example as a YAML file (I went to the online editor http://editor.swagger.io/#/ and imported the Weather API JSON file I'd manually created and exported that as a YAML file). After which the normal swagger project edit brought up the "Simple Weather API" file just fine.

So, is there a simpler way to open (or import) an existing JSON file into a project? Or can the project editor convert to/from JSON/YAML?

Thanks P.S. I originally opened this issue in the swagger-tools repo and was told the issue was a "swagger-node design feature"

yarax commented 8 years ago

Thank you for the issue, I will take a look

DiegoZoracKy commented 8 years ago

I still don't find a "file" option on the top menu as we find at editor.swagger.io. Am i missing some config?

jerelim commented 8 years ago

@DiegoZoracKy , it's not just you, i don't see it too.

larryaubstore commented 8 years ago

I have the same issue.

alterx commented 8 years ago

I have the same issue here, it looks like they just added a portion of the editor, anyway I just added a new npm script and a new dependency to my package.json file:

"devDependencies": { "yamljs": "^0.2.8" }, "scripts": { "start": "node app.js", "test": "swagger project test", "json": "node ./node_modules/yamljs/cli/yaml2json.js ./api/swagger/swagger.yaml > ./public/swagger.json" }

Then you can run npm run json and you'll have your .json file generated

barlowm commented 7 years ago

@yarax - Any further progress on this issue?