diff --git a/.golangci.yml b/.golangci.yml index dc7c960..9d27331 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -4,7 +4,10 @@ linters: disable: - depguard - funlen + - goconst - godox + - gomodguard + - gomodguard_v2 - exhaustruct - nlreturn - nonamedreturns diff --git a/debug_test.go b/debug_test.go index 6f6547b..af99d1e 100644 --- a/debug_test.go +++ b/debug_test.go @@ -38,7 +38,7 @@ func TestDebug(t *testing.T) { Debug = false _ = tmpFile.Close() - flushed, _ := os.Open(tmpName) //nolint:gosec // test file, path is from os.CreateTemp + flushed, _ := os.Open(tmpName) buf := make([]byte, 500) _, _ = flushed.Read(buf) specLogger.SetOutput(os.Stdout) diff --git a/header.go b/header.go index 599ba2c..f656e07 100644 --- a/header.go +++ b/header.go @@ -150,7 +150,11 @@ func (h Header) MarshalJSON() ([]byte, error) { if err != nil { return nil, err } - return jsonutils.ConcatJSON(b1, b2, b3), nil + b4, err := json.Marshal(h.VendorExtensible) + if err != nil { + return nil, err + } + return jsonutils.ConcatJSON(b1, b2, b3, b4), nil } // UnmarshalJSON unmarshals this header from JSON. diff --git a/header_test.go b/header_test.go index ad34da3..e6e0b1a 100644 --- a/header_test.go +++ b/header_test.go @@ -75,6 +75,7 @@ const headerJSON = `{ func TestIntegrationHeader(t *testing.T) { assert.JSONUnmarshalAsT(t, header, headerJSON) + assert.JSONMarshalAsT(t, headerJSON, header) } func TestJSONLookupHeader(t *testing.T) { diff --git a/schema_loader.go b/schema_loader.go index 0894c93..1e34606 100644 --- a/schema_loader.go +++ b/schema_loader.go @@ -117,7 +117,7 @@ func (r *schemaLoader) updateBasePath(transitive *schemaLoader, basePath string) func (r *schemaLoader) resolveRef(ref *Ref, target any, basePath string) error { tgt := reflect.ValueOf(target) - if tgt.Kind() != reflect.Ptr { + if tgt.Kind() != reflect.Pointer { return ErrResolveRefNeedsAPointer }