mlabouardy / swaggymnia

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

cannot run on mac #7

Open saturngod opened 6 years ago

saturngod commented 6 years ago

Expected behavior

Get the swagger json format

Current behavior

panic: assignment to entry in nil map

goroutine 1 [running]:
main.parse(0xc420010ae0, 0x6, 0x3, 0xed2057f5f, 0x1e848000, 0x0, 0xc42000ac20, 0x1c, 0xc4200ad900, 0x8, ...)
    C:/Users/Mohamed/go/src/github.com/mlabouardy/swaggymnia/swagger.go:51 +0x32c
main.(*Swagger).Generate(0xc42018b7d8, 0x7ffeefbff9f0, 0x16, 0x7ffeefbffa0f, 0xb, 0x7ffeefbffa1e, 0x4)
    C:/Users/Mohamed/go/src/github.com/mlabouardy/swaggymnia/swagger.go:83 +0x11f
main.main.func1(0xc420076840, 0x10100, 0xc420076840)
    C:/Users/Mohamed/go/src/github.com/mlabouardy/swaggymnia/app.go:57 +0x180
github.com/urfave/cli.HandleAction(0x11bd260, 0x12080d8, 0xc420076840, 0xc420060300, 0x0)
    C:/Users/Mohamed/go/src/github.com/urfave/cli/app.go:502 +0xd4
github.com/urfave/cli.Command.Run(0x11fab4d, 0x8, 0x0, 0x0, 0xc420010880, 0x1, 0x1, 0x1202246, 0x1e, 0x0, ...)
    C:/Users/Mohamed/go/src/github.com/urfave/cli/command.go:210 +0xb87
github.com/urfave/cli.(*App).Run(0xc4200b81c0, 0xc42000e080, 0x8, 0x8, 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 -insomnia 2018-02-02.json -config config.json -o json
faiverson commented 6 years ago

For me even worse. I just downloaded from [wget https://s3.amazonaws.com/swaggymnia/1.0.0-beta/osx/swaggymnia] and I get

screen shot 2018-02-05 at 4 41 45 pm
mlabouardy commented 6 years ago

@faiverson you need to add execution permission (chmod +x swaggymnia) :)

mlabouardy commented 6 years ago

@saturngod can you share your 2018-02-02.json file :)

faiverson commented 6 years ago

@mlabouardy chmod 777 includes permissions for read, write and execute for everybody That's not the solution. The image is very clear.

mlabouardy commented 6 years ago

@faiverson you need to add the binary to the PATH variable or use the relative path to use the cli ./swaggymnia --help

saturngod commented 6 years ago

@mlabouardy I will send you from email.

faiverson commented 6 years ago

I got a similar error:

screen shot 2018-03-20 at 5 14 50 pm

MacBook Pro (Retina, 15-inch, Mid 2014) macOS Sierra v10.12.6 (16G1114)

drssdinblck commented 6 years ago

Also tried it out inside a docker container running Linux, does not work as well.

FROM golang:1.11.2-stretch
WORKDIR /app
COPY . .
RUN go get github.com/mlabouardy/swaggymnia
CMD ["/bin/bash"]

output:

$ docker run -ti swago
root@daefe1595b01:/app# swaggymnia generate -i insomnia.json -c config.json -o yaml
panic: assignment to entry in nil map

goroutine 1 [running]:
main.parse(0xc000082448, 0x6, 0x3, 0xe205540, 0xed37c9fdc, 0x0, 0xc0000c6140, 0x1b, 0xc0000c9900, 0x8, ...)
    /go/src/github.com/mlabouardy/swaggymnia/swagger.go:51 +0x216
main.(*Swagger).Generate(0xc0000f99f0, 0x7ffdfd45fef1, 0xd, 0x7ffdfd45ff02, 0xb, 0x7ffdfd45ff11, 0x4)
    /go/src/github.com/mlabouardy/swaggymnia/swagger.go:83 +0x11e
main.main.func1(0xc000098580, 0xc000092200, 0xc000098580)
    /go/src/github.com/mlabouardy/swaggymnia/app.go:57 +0x1aa
github.com/urfave/cli.HandleAction(0x5bcde0, 0x60aad8, 0xc000098580, 0x0, 0xc000092300)
    /go/src/github.com/urfave/cli/app.go:501 +0xc8
github.com/urfave/cli.Command.Run(0x5fca44, 0x8, 0x0, 0x0, 0xc00006e4b0, 0x1, 0x1, 0x6042be, 0x1e, 0x0, ...)
    /go/src/github.com/urfave/cli/command.go:165 +0x459
github.com/urfave/cli.(*App).Run(0xc0000d41c0, 0xc00000e080, 0x8, 0x8, 0x0, 0x0)
    /go/src/github.com/urfave/cli/app.go:259 +0x6bb
main.main()
    /go/src/github.com/mlabouardy/swaggymnia/app.go:66 +0x4a0
Fyb3roptik commented 5 years ago

This is still an issue on Mac for me. Getting the same error!

@mlabouardy

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

Epistol commented 5 years ago

Still not added as command on mac even with Fyb3roptik solution

Fyb3roptik commented 5 years ago

What do you mean not added as a command? if you're in the same folder as it then run ./swaggymnia or you can add your bin PATH to pwd

dwihujianto commented 5 years ago

Same problem on Ubuntu 17.10

Command

./swaggymnia generate -insomnia project.json -config config.json -o json

Result

panic: assignment to entry in nil map

goroutine 1 [running]:
main.parse(0xc420014b30, 0x6, 0x3, 0xed3f78160, 0x35e1f200, 0x0, 0xc42000b100, 0x1b, 0xc420104000, 0x20, ...)
        C:/Users/Mohamed/go/src/github.com/mlabouardy/swaggymnia/swagger.go:51 +0x32c
main.(*Swagger).Generate(0xc4200df7d8, 0x7ffc2f0f026f, 0x18, 0x7ffc2f0f0290, 0xb, 0x7ffc2f0f029f, 0x4)
        C:/Users/Mohamed/go/src/github.com/mlabouardy/swaggymnia/swagger.go:83 +0x11f
main.main.func1(0xc420088840, 0x10100, 0xc420088840)
        C:/Users/Mohamed/go/src/github.com/mlabouardy/swaggymnia/app.go:57 +0x180
github.com/urfave/cli.HandleAction(0x5bd740, 0x608ba0, 0xc420088840, 0xc42001a300, 0x0)
        C:/Users/Mohamed/go/src/github.com/urfave/cli/app.go:502 +0xd4
github.com/urfave/cli.Command.Run(0x5fb2c0, 0x8, 0x0, 0x0, 0xc4200148d0, 0x1, 0x1, 0x602cf6, 0x1e, 0x0, ...)
        C:/Users/Mohamed/go/src/github.com/urfave/cli/command.go:210 +0xb87
github.com/urfave/cli.(*App).Run(0xc4200c01c0, 0xc42000e100, 0x8, 0x8, 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
iulian-r commented 5 years ago

It looks like there is a PR fixing this problem. Is it this project still maintained?

xikyu46 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

Can you make this fixed binay for linux?

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

15-apoorva commented 3 years ago

@Fyb3roptik Not able to download it for MacOS from https://s3-us-west-2.amazonaws.com/jrpublic/mac/swaggymnia. Getting permission forbidden error. is the link still same?

Fyb3roptik commented 3 years ago

Check out my repo here https://github.com/Fyb3roptik/swaggomnia There are releases