From 880deb984ba9994543e98d9e456f71deac1c9e59 Mon Sep 17 00:00:00 2001 From: Dayna Blackwell Date: Sun, 23 Aug 2026 17:25:45 -0700 Subject: [PATCH 1/2] chore(deps): update gcf-go from v1.5.0 to v1.7.1 Brings oq's gcf-go dependency current. Three correctness fixes shipped since v1.5.0: - v1.6.1: count enforcement (SPEC 13) - decode rejects a declared row count that does not match the rows present, rather than silently truncating. - v1.7.0: int64 numeric domain - numbers outside the int64 domain are handled explicitly instead of silently losing precision. - v1.7.1: quoted-key / array-value round-trip - fixes a decode bug where a '[' inside a quoted key was read as the array-count bracket. go.mod + go.sum only; no code or API change. EncodeGeneric's signature is unchanged, so oq/format.go is untouched. --- cmd/openapi/go.mod | 2 +- cmd/openapi/go.sum | 4 ++-- go.mod | 2 +- go.sum | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/openapi/go.mod b/cmd/openapi/go.mod index a03e001..d554dc8 100644 --- a/cmd/openapi/go.mod +++ b/cmd/openapi/go.mod @@ -16,7 +16,7 @@ require ( require ( github.com/atotto/clipboard v0.1.4 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect - github.com/blackwell-systems/gcf-go v1.5.0 // indirect + github.com/blackwell-systems/gcf-go v1.7.1 // indirect github.com/charmbracelet/colorprofile v0.4.1 // indirect github.com/charmbracelet/x/ansi v0.11.6 // indirect github.com/charmbracelet/x/cellbuf v0.0.15 // indirect diff --git a/cmd/openapi/go.sum b/cmd/openapi/go.sum index 6f2e031..3b57ff4 100644 --- a/cmd/openapi/go.sum +++ b/cmd/openapi/go.sum @@ -4,8 +4,8 @@ github.com/atotto/clipboard v0.1.4 h1:EH0zSVneZPSuFR11BlR9YppQTVDbh5+16AmcJi4g1z github.com/atotto/clipboard v0.1.4/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI= github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= -github.com/blackwell-systems/gcf-go v1.5.0 h1:ZOWyxvRF1TZOmzPYXVO1dOTU6VRslNaJgnzSDDh8hL4= -github.com/blackwell-systems/gcf-go v1.5.0/go.mod h1:hYxLOn6JHzNNNH7wfgRXWETX2lMtRtjG8FEX45I6SAI= +github.com/blackwell-systems/gcf-go v1.7.1 h1:hpdCf/GHXS/CrsXsHnnIw6hXBHhtC2dopGOdiFMnsc4= +github.com/blackwell-systems/gcf-go v1.7.1/go.mod h1:hYxLOn6JHzNNNH7wfgRXWETX2lMtRtjG8FEX45I6SAI= github.com/charmbracelet/bubbles v1.0.0 h1:12J8/ak/uCZEMQ6KU7pcfwceyjLlWsDLAxB5fXonfvc= github.com/charmbracelet/bubbles v1.0.0/go.mod h1:9d/Zd5GdnauMI5ivUIVisuEm3ave1XwXtD1ckyV6r3E= github.com/charmbracelet/bubbletea v1.3.10 h1:otUDHWMMzQSB0Pkc87rm691KZ3SWa4KUlvF9nRvCICw= diff --git a/go.mod b/go.mod index d7086a4..f22768f 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/speakeasy-api/openapi go 1.25.0 require ( - github.com/blackwell-systems/gcf-go v1.5.0 + github.com/blackwell-systems/gcf-go v1.7.1 github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 github.com/speakeasy-api/jsonpath v0.6.3 github.com/stretchr/testify v1.11.1 diff --git a/go.sum b/go.sum index 60c7035..3d1feaa 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/blackwell-systems/gcf-go v1.5.0 h1:ZOWyxvRF1TZOmzPYXVO1dOTU6VRslNaJgnzSDDh8hL4= -github.com/blackwell-systems/gcf-go v1.5.0/go.mod h1:hYxLOn6JHzNNNH7wfgRXWETX2lMtRtjG8FEX45I6SAI= +github.com/blackwell-systems/gcf-go v1.7.1 h1:hpdCf/GHXS/CrsXsHnnIw6hXBHhtC2dopGOdiFMnsc4= +github.com/blackwell-systems/gcf-go v1.7.1/go.mod h1:hYxLOn6JHzNNNH7wfgRXWETX2lMtRtjG8FEX45I6SAI= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= From 070e1656daa17fc54b4997a526213f50546db056 Mon Sep 17 00:00:00 2001 From: Dayna Blackwell Date: Tue, 25 Aug 2026 13:22:45 -0700 Subject: [PATCH 2/2] test(oq): add golden coverage for GCF array and marker-shaped string output Pins the --format gcf output for the two shapes affected by the gcf-go v1.7.1 bump: an array-valued projection (emitted as a ^ array attachment) and a marker-shaped (^{...}) string (quoted). The default petstore smoke query exercises neither. --- oq/format_test.go | 53 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/oq/format_test.go b/oq/format_test.go index 3f8653e..2ebbfdc 100644 --- a/oq/format_test.go +++ b/oq/format_test.go @@ -16,3 +16,56 @@ func TestToonValue_ArrayEscapesSemicolonElements(t *testing.T) { assert.Equal(t, `"v1;deprecated";"v2;current"`, encoded, "array elements containing the delimiter should be quoted individually") } + +// TestFormatGCF_ArrayValuedProjection pins the GCF output for a projection that +// includes an array-valued field. FormatGCF passes array fields to the encoder as +// []string, which are emitted as a GCF array attachment (a "^" marker on the row +// plus a ".scopes [N]: ..." continuation line) rather than a single scalar cell. +// This golden covers the array path that the default petstore smoke query does not +// exercise (its operation fields contain no arrays). +func TestFormatGCF_ArrayValuedProjection(t *testing.T) { + t.Parallel() + + // SecurityRequirement rows read schemeName/scopes directly off the Row, so this + // drives FormatGCF end to end without needing a populated SchemaGraph. + result := &Result{ + Rows: []Row{{ + Kind: SecurityRequirementResult, + SchemeName: "petstore_auth", + Scopes: []string{"read:pets", "write:pets"}, + }}, + Fields: []string{"schemeName", "scopes"}, + } + + got := FormatGCF(result, nil) + + want := "GCF profile=generic\n" + + "## [1]{schemeName,scopes}\n" + + "@0 petstore_auth|^\n" + + ".scopes [2]: read:pets,write:pets\n" + assert.Equal(t, want, got, "array-valued fields should emit as a GCF array attachment") +} + +// TestFormatGCF_MarkerShapedStringQuoted pins the GCF output for a string value +// shaped like a GCF marker ("^{...}"). Such values are quoted rather than emitted +// bare so they round-trip as literal strings instead of being read as markup. +func TestFormatGCF_MarkerShapedStringQuoted(t *testing.T) { + t.Parallel() + + result := &Result{ + Rows: []Row{{ + Kind: SecurityRequirementResult, + SchemeName: "^{oauth}", + Scopes: []string{"read"}, + }}, + Fields: []string{"schemeName", "scopes"}, + } + + got := FormatGCF(result, nil) + + want := "GCF profile=generic\n" + + "## [1]{schemeName,scopes}\n" + + "@0 \"^{oauth}\"|^\n" + + ".scopes [1]: read\n" + assert.Equal(t, want, got, "marker-shaped string values should be quoted") +}