swaggymnia icon indicating copy to clipboard operation
swaggymnia copied to clipboard

cannot run on mac

Open saturngod opened this issue 6 years ago • 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

saturngod avatar Feb 01 '18 21:02 saturngod

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

faiverson avatar Feb 05 '18 19:02 faiverson

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

mlabouardy avatar Feb 08 '18 10:02 mlabouardy

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

mlabouardy avatar Feb 08 '18 10:02 mlabouardy

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

faiverson avatar Feb 08 '18 14:02 faiverson

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

mlabouardy avatar Feb 16 '18 14:02 mlabouardy

@mlabouardy I will send you from email.

saturngod avatar Mar 15 '18 03:03 saturngod

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)

faiverson avatar Mar 20 '18 20:03 faiverson

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

drssdinblck avatar Nov 13 '18 10:11 drssdinblck

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

@mlabouardy

Fyb3roptik avatar Feb 13 '19 00:02 Fyb3roptik

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

Fyb3roptik avatar Feb 14 '19 23:02 Fyb3roptik

Still not added as command on mac even with Fyb3roptik solution

Epistol avatar Feb 22 '19 08:02 Epistol

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

Fyb3roptik avatar Feb 22 '19 17:02 Fyb3roptik

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

dwihujianto avatar Mar 06 '19 02:03 dwihujianto

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

iulian-r avatar Mar 19 '19 08:03 iulian-r

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?

xikyu46 avatar May 23 '19 09:05 xikyu46

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 avatar May 23 '19 15:05 Fyb3roptik

https://github.com/Fyb3roptik/swaggomnia

Fyb3roptik avatar Jun 04 '19 17:06 Fyb3roptik

@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?

15-apoorva avatar Feb 16 '21 15:02 15-apoorva

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

Fyb3roptik avatar Feb 18 '21 02:02 Fyb3roptik