cannot run on mac
Opened this issue · 19 comments
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 you need to add execution permission (chmod +x swaggymnia) :)
@saturngod can you share your 2018-02-02.json file :)
@mlabouardy chmod 777 includes permissions for read, write and execute for everybody
That's not the solution. The image is very clear.
@faiverson you need to add the binary to the PATH variable or use the relative path to use the cli
./swaggymnia --help
@mlabouardy I will send you from email.
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
This is still an issue on Mac for me. Getting the same error!
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
Still not added as command on mac even with Fyb3roptik solution
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
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
It looks like there is a PR fixing this problem.
Is it this project still maintained?
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
Can you make this fixed binay for linux?
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 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?
Check out my repo here https://github.com/Fyb3roptik/swaggomnia There are releases