bugfix panic: assignment to entry in nil map #20
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
➜ Downloads ./swaggymnia generate -i Insomnia_2021-10-26.json -o json -c config.json
panic: assignment to entry in nil map
goroutine 1 [running]:
main.parse(0xc420016b10, 0x6, 0x4, 0xed9095a9c, 0x206cc800, 0x0, 0xc42000ad80, 0x1e, 0xc42017e000, 0xd7, ...)
C:/Users/Mohamed/go/src/github.com/mlabouardy/swaggymnia/swagger.go:51 +0x32c
main.(*Swagger).Generate(0xc4201057d8, 0x7ffeefbff791, 0x18, 0x7ffeefbff7b5, 0xb, 0x7ffeefbff7ad, 0x4)
C:/Users/Mohamed/go/src/github.com/mlabouardy/swaggymnia/swagger.go:83 +0x11f
main.main.func1(0xc42008c840, 0x10100, 0xc42008c840)
C:/Users/Mohamed/go/src/github.com/mlabouardy/swaggymnia/app.go:57 +0x180
github.com/urfave/cli.HandleAction(0x11bd260, 0x12080d8, 0xc42008c840, 0xc420076300, 0x0)
C:/Users/Mohamed/go/src/github.com/urfave/cli/app.go:502 +0xd4
github.com/urfave/cli.Command.Run(0x11fab4d, 0x8, 0x0, 0x0, 0xc4200168b0, 0x1, 0x1, 0x1202246, 0x1e, 0x0, ...)
C:/Users/Mohamed/go/src/github.com/urfave/cli/command.go:210 +0xb87
github.com/urfave/cli.(*App).Run(0xc4200d01c0, 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
Related Issue
#16 #10 #8 #7
Changes proposed
resource of type REQUEST mybe appear before it's parent of REQUEST_GROUP
Screenshots