pb33f / openapi-changes

The world's sexiest OpenAPI breaking changes detector. Discover what changed between two OpenAPI specs, or a single spec over time. Supports OpenAPI 3.1, 3.0 and Swagger
https://pb33f.io/openapi-changes/
Other
180 stars 16 forks source link

"segmentation violation" in 'summary' command in v0.0.66 #155

Closed gavvvr closed 2 months ago

gavvvr commented 2 months ago

Hello

The v0.0.66 is broken, the summary command does not work:

▀  starting work. (0s)panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x59525a]

goroutine 6 [running]:
github.com/pterm/pterm.(*SpinnerPrinter).UpdateText(0xc000064e78?, {0xc000136ae0?, 0x17afb20?})
        /go/pkg/mod/github.com/pterm/pterm@v0.12.79/spinner_printer.go:121 +0x1a
github.com/pb33f/openapi-changes/cmd.GetSummaryCommand.func1.1(0xc00010a1e0, 0xc00010a240)
        /opt/openapi-changes/cmd/summary.go:95 +0x536
created by github.com/pb33f/openapi-changes/cmd.GetSummaryCommand.func1 in goroutine 1
        /opt/openapi-changes/cmd/summary.go:232 +0x6a5

How to reproduce

1) Have the following spec.json in your working directory:

{
    "openapi": "3.1.0",
    "jsonSchemaDialect": "https://spec.openapis.org/oas/3.1/dialect/base",
    "info": {
        "title": "",
        "version": "",
        "description": ""
    },
    "servers": [],
    "paths": [],
    "webhooks": {},
    "components": {},
    "security": [],
    "tags": []
}

2) run the tool with docker run --rm -it -vpwd:/work pb33f/openapi-changes:v0.0.66 summary spec.json spec.json

The previous version v0.0.65 does not have the problem

daveshanley commented 2 months ago

Oh dear, this was a recent community addition. I will resolve today.

daveshanley commented 2 months ago

fixed in v0.0.67