Skip to content

Instantly share code, notes, and snippets.

@jbub
Created October 19, 2016 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbub/b7f4219f79ae3d77cae637ec90b26e86 to your computer and use it in GitHub Desktop.
Save jbub/b7f4219f79ae3d77cae637ec90b26e86 to your computer and use it in GitHub Desktop.
$ swagger validate swagger.yaml
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xe1ee7]
goroutine 1 [running]:
panic(0x689080, 0xc420014090)
/usr/local/go/src/runtime/panic.go:500 +0x1a1
github.com/go-swagger/go-swagger/vendor/github.com/go-openapi/spec.expandSchema(0x0, 0x0, 0x0, 0xc4201a9a00, 0x0, 0x0, 0x0, 0x100, 0x0, 0x0, ...)
/go/src/github.com/go-swagger/go-swagger/vendor/github.com/go-openapi/spec/expander.go:446 +0x3e7
github.com/go-swagger/go-swagger/vendor/github.com/go-openapi/spec.expandItems(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/go/src/github.com/go-swagger/go-swagger/vendor/github.com/go-openapi/spec/expander.go:405 +0x2cf
github.com/go-swagger/go-swagger/vendor/github.com/go-openapi/spec.expandSchema(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/go/src/github.com/go-swagger/go-swagger/vendor/github.com/go-openapi/spec/expander.go:449 +0x58e
github.com/go-swagger/go-swagger/vendor/github.com/go-openapi/spec.expandResponse(0xc42077bbd0, 0xc4207fc780, 0xc4207128a0, 0x0)
/go/src/github.com/go-swagger/go-swagger/vendor/github.com/go-openapi/spec/expander.go:602 +0x1ff
github.com/go-swagger/go-swagger/vendor/github.com/go-openapi/spec.expandOperation(0xc4201175e0, 0xc4207fc780, 0x0, 0xc420712f70)
/go/src/github.com/go-swagger/go-swagger/vendor/github.com/go-openapi/spec/expander.go:575 +0x31b
github.com/go-swagger/go-swagger/vendor/github.com/go-openapi/spec.expandPathItem(0xc42011ae00, 0xc4207fc780, 0xc420712f70, 0xadde40)
/go/src/github.com/go-swagger/go-swagger/vendor/github.com/go-openapi/spec/expander.go:534 +0x14e
github.com/go-swagger/go-swagger/vendor/github.com/go-openapi/spec.ExpandSpec(0xc4201f7b00, 0xe42, 0x1023)
/go/src/github.com/go-swagger/go-swagger/vendor/github.com/go-openapi/spec/expander.go:351 +0x7a1
github.com/go-swagger/go-swagger/vendor/github.com/go-openapi/loads.(*Document).Expanded(0xc420575d40, 0xc4202eb501, 0x5, 0x8)
/go/src/github.com/go-swagger/go-swagger/vendor/github.com/go-openapi/loads/spec.go:140 +0x91
github.com/go-swagger/go-swagger/vendor/github.com/go-openapi/validate.(*SpecValidator).validateReferencesValid(0xc420713ac8, 0xc4208c1d80)
/go/src/github.com/go-swagger/go-swagger/vendor/github.com/go-openapi/validate/spec.go:614 +0x181
github.com/go-swagger/go-swagger/vendor/github.com/go-openapi/validate.(*SpecValidator).Validate(0xc420713ac8, 0x6eb3e0, 0xc420575d40, 0x1023, 0x734f36)
/go/src/github.com/go-swagger/go-swagger/vendor/github.com/go-openapi/validate/spec.go:113 +0x2a4
github.com/go-swagger/go-swagger/vendor/github.com/go-openapi/validate.Spec(0xc420575d40, 0xae5300, 0xc420473020, 0x0, 0x0)
/go/src/github.com/go-swagger/go-swagger/vendor/github.com/go-openapi/validate/spec.go:50 +0x81
github.com/go-swagger/go-swagger/cmd/swagger/commands.(*ValidateSpec).Execute(0xb4baf0, 0xc42057f8e0, 0x1, 0x2, 0x1, 0x2)
/go/src/github.com/go-swagger/go-swagger/cmd/swagger/commands/validate.go:46 +0xbe
github.com/go-swagger/go-swagger/vendor/github.com/jessevdk/go-flags.(*Parser).ParseArgs(0xc420017800, 0xc4200780a0, 0x2, 0x2, 0x8, 0x4, 0xc42001a900, 0xc42021bf80, 0xc4202535c8)
/go/src/github.com/go-swagger/go-swagger/vendor/github.com/jessevdk/go-flags/parser.go:315 +0x8e6
github.com/go-swagger/go-swagger/vendor/github.com/jessevdk/go-flags.(*Parser).Parse(0xc420017800, 0x6, 0x737738, 0x6, 0x1, 0x77c2b1)
/go/src/github.com/go-swagger/go-swagger/vendor/github.com/jessevdk/go-flags/parser.go:185 +0x74
main.main()
/go/src/github.com/go-swagger/go-swagger/cmd/swagger/swagger.go:90 +0x455
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment