mlabouardy / swaggymnia

Generate Swagger 🌀 documentation for your existing API in Insomnia
MIT License
426 stars 31 forks source link

It does not work #8

Open dardox opened 6 years ago

dardox commented 6 years ago

Expected behavior

Generate json/yaml file

Current behavior

Shows this message

panic: assignment to entry in nil map

goroutine 1 [running]: main.parse(0xc420012b80, 0x6, 0x3, 0xed21616c2, 0x2756cd00, 0x0, 0xc42000b020, 0x1c, 0xc42011c000, 0xa, ...) C:/Users/Mohamed/go/src/github.com/mlabouardy/swaggymnia/swagger.go:51 +0x32c main.(Swagger).Generate(0xc4201197d8, 0x7ffca03811e1, 0x1d, 0x7ffca0381202, 0x9, 0x5f8620, 0x4) C:/Users/Mohamed/go/src/github.com/mlabouardy/swaggymnia/swagger.go:83 +0x11f main.main.func1(0xc420088840, 0x100, 0xc420088840) C:/Users/Mohamed/go/src/github.com/mlabouardy/swaggymnia/app.go:57 +0x180 github.com/urfave/cli.HandleAction(0x5bd740, 0x608ba0, 0xc420088840, 0xc42000e400, 0x0) C:/Users/Mohamed/go/src/github.com/urfave/cli/app.go:502 +0xd4 github.com/urfave/cli.Command.Run(0x5fb2c0, 0x8, 0x0, 0x0, 0xc4200128e0, 0x1, 0x1, 0x602cf6, 0x1e, 0x0, ...) C:/Users/Mohamed/go/src/github.com/urfave/cli/command.go:210 +0xb87 github.com/urfave/cli.(App).Run(0xc4200c41c0, 0xc42000e0c0, 0x6, 0x6, 0x0, 0x0) C:/Users/Mohamed/go/src/github.com/urfave/cli/app.go:259 +0x7b7 main.main() C:/Users/Mohamed/go/src/github.com/mlabouardy/swaggymnia/app.go:66 +0x515

Steps to reproduce the behavior

swaggymnia generate -i rest.json -c config.json yaml

Fyb3roptik commented 5 years ago

Here is a fixed binary for MacOS. If Windows people or Linux people need a new binary please let me know and I can make one

https://s3-us-west-2.amazonaws.com/jrpublic/swaggymnia

pramanikriju commented 5 years ago

Can we get one for windows?

Fyb3roptik commented 5 years ago

https://s3-us-west-2.amazonaws.com/jrpublic/swaggymnia.exe - Windows 64bit

yochrisbolton commented 5 years ago

Hi! I'm not sure how to build Go Apps, do you have a binary for Linux? Cheers :beers:

Edit: I just used the Windows version through wine. Combined with writing the spec by hand seems to be working OK!

Fyb3roptik commented 5 years ago

Here are all 3

Windows - 64bit

https://s3-us-west-2.amazonaws.com/jrpublic/windows/swaggymnia.exe

Mac

https://s3-us-west-2.amazonaws.com/jrpublic/mac/swaggymnia

Linux - 64bit

https://s3-us-west-2.amazonaws.com/jrpublic/linux/swaggymnia

Fyb3roptik commented 5 years ago

https://github.com/Fyb3roptik/swaggomnia

kkashyap1707 commented 5 years ago

@Fyb3roptik I am still facing the issue. In this

  1. I am not able to convert the output into Json format.
  2. Not able to see API information using yaml file. Screenshot from 2019-06-06 16-22-32 Screenshot from 2019-06-06 16-20-28
Fyb3roptik commented 5 years ago

Well for 1 I have posted the new repo above and 2, you dont use the yaml file there, you use it on the swagger site!

kkashyap1707 commented 5 years ago

I am using your new repo and the above question arises from that repo. Please add the steps to generate in the readme.md file on that repo.

Fyb3roptik commented 5 years ago

You will want to find the file itself and not try to browse to it via a url. It should create the file in the same directory as you're running it in.

I move the json file, config file and swaggomnia into a folder and run it, it should output either a json file or yaml file depending on what you ran