Repository: swaggest/openapi-go
Pull request #68 (2023-07-23 10:18:52)

Update deps

github-actions[bot]: ### Lines Of Code

| Language  | Files |   Lines    |    Code    | Comments |  Blanks   | Complexity |     Bytes      |
|-----------|-------|------------|------------|----------|-----------|------------|----------------|
| Go (test) | 7     | 2017 (-35) | 1469 (-23) | 309      | 239 (-12) | 27         | 52.1K (-1017B) |
| YAML      | 5     | 360 (-2)   | 295 (-2)   | 29       | 36        | 0          | 11.6K (-53B)   |
<!-- Sticky Pull Request CommentLOC -->
github-actions[bot]: ### Go API Changes

<pre>
# summary
Inferred base version: v0.2.30
Suggested version: v0.3.0
</pre>
<!-- Sticky Pull Request Commentgorelease -->
github-actions[bot]: ### Unit Test Coverage
total:								(statements)				49.8%

<details><summary>Coverage of changed lines</summary>

No changes in testable statements.

</details>

<details><summary>Coverage diff with base branch</summary>

No changes in coverage.

</details>
<!-- Sticky Pull Request Commentunit-test -->
codecov[bot]: ## [Codecov](https://app.codecov.io/gh/swaggest/openapi-go/pull/68?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=swaggest) Report
> Merging [#68](https://app.codecov.io/gh/swaggest/openapi-go/pull/68?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=swaggest) (e1a14aa) into [master](https://app.codecov.io/gh/swaggest/openapi-go/commit/dae9ebff5967f78efec21f8047b5d3494fce689e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=swaggest) (dae9ebf) will **not change** coverage.
> The diff coverage is `n/a`.

```diff
@@           Coverage Diff           @@
##           master      #68   +/-   ##
=======================================
  Coverage   42.17%   42.17%           
=======================================
  Files           5        5           
  Lines        3585     3585           
=======================================
  Hits         1512     1512           
  Misses       1784     1784           
  Partials      289      289           
```

| Flag | Coverage Δ | |
|---|---|---|
| unittests | `42.17% <ø> (ø)` | |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=swaggest#carryforward-flags-in-the-pull-request-comment) to find out more.


:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=swaggest)


Patch:
diff --git a/.github/workflows/cloc.yml b/.github/workflows/cloc.yml
index 927e099..3f1fc19 100644
--- a/.github/workflows/cloc.yml
+++ b/.github/workflows/cloc.yml
@@ -13,11 +13,11 @@ jobs:
     runs-on: ubuntu-latest
     steps:
       - name: Checkout code
-        uses: actions/checkout@v2
+        uses: actions/checkout@v3
         with:
           path: pr
       - name: Checkout base code
-        uses: actions/checkout@v2
+        uses: actions/checkout@v3
         with:
           ref: ${{ github.event.pull_request.base.sha }}
           path: base
diff --git a/.github/workflows/gorelease.yml b/.github/workflows/gorelease.yml
index 5fb995e..41767ba 100644
--- a/.github/workflows/gorelease.yml
+++ b/.github/workflows/gorelease.yml
@@ -16,7 +16,7 @@ jobs:
     steps:
       - name: Install Go stable
         if: env.GO_VERSION != 'tip'
-        uses: actions/setup-go@v3
+        uses: actions/setup-go@v4
         with:
           go-version: ${{ env.GO_VERSION }}
       - name: Install Go tip
@@ -29,9 +29,9 @@ jobs:
           ~/sdk/gotip/bin/go version
           echo "PATH=$HOME/go/bin:$HOME/sdk/gotip/bin/:$PATH" >> $GITHUB_ENV
       - name: Checkout code
-        uses: actions/checkout@v2
+        uses: actions/checkout@v3
       - name: Gorelease cache
-        uses: actions/cache@v2
+        uses: actions/cache@v3
         with:
           path: |
             ~/go/bin/gorelease
diff --git a/.golangci.yml b/.golangci.yml
index 68bf06e..2ff155d 100644
--- a/.golangci.yml
+++ b/.golangci.yml
@@ -53,8 +53,6 @@ linters:
     - dupword
 
 issues:
-  exclude:
-    - "\"io/ioutil\" has been deprecated"
   exclude-use-default: false
   exclude-rules:
     - linters:
diff --git a/go.mod b/go.mod
index 9feefc3..8a2953d 100644
--- a/go.mod
+++ b/go.mod
@@ -3,10 +3,10 @@ module github.com/swaggest/openapi-go
 go 1.18
 
 require (
-	github.com/bool64/dev v0.2.27
+	github.com/bool64/dev v0.2.29
 	github.com/stretchr/testify v1.8.2
-	github.com/swaggest/assertjson v1.8.0
-	github.com/swaggest/jsonschema-go v0.3.50
+	github.com/swaggest/assertjson v1.9.0
+	github.com/swaggest/jsonschema-go v0.3.52
 	github.com/swaggest/refl v1.1.0
 	gopkg.in/yaml.v2 v2.4.0
 )
@@ -15,7 +15,7 @@ require (
 	github.com/bool64/shared v0.1.5 // indirect
 	github.com/davecgh/go-spew v1.1.1 // indirect
 	github.com/fsnotify/fsnotify v1.4.9 // indirect
-	github.com/iancoleman/orderedmap v0.2.0 // indirect
+	github.com/iancoleman/orderedmap v0.3.0 // indirect
 	github.com/pmezard/go-difflib v1.0.0 // indirect
 	github.com/sergi/go-diff v1.3.1 // indirect
 	github.com/yudai/gojsondiff v1.0.0 // indirect
diff --git a/go.sum b/go.sum
index 861d092..e19a01c 100644
--- a/go.sum
+++ b/go.sum
@@ -1,5 +1,5 @@
-github.com/bool64/dev v0.2.27 h1:mFT+B74mFVgUeUmm/EbfM6ELPA55lEXBjQ/AOHCwCOc=
-github.com/bool64/dev v0.2.27/go.mod h1:iJbh1y/HkunEPhgebWRNcs8wfGq7sjvJ6W5iabL8ACg=
+github.com/bool64/dev v0.2.29 h1:x+syGyh+0eWtOzQ1ItvLzOGIWyNWnyjXpHIcpF2HvL4=
+github.com/bool64/dev v0.2.29/go.mod h1:iJbh1y/HkunEPhgebWRNcs8wfGq7sjvJ6W5iabL8ACg=
 github.com/bool64/shared v0.1.5 h1:fp3eUhBsrSjNCQPcSdQqZxxh9bBwrYiZ+zOKFkM0/2E=
 github.com/bool64/shared v0.1.5/go.mod h1:081yz68YC9jeFB3+Bbmno2RFWvGKv1lPKkMP6MHJlPs=
 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -7,8 +7,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
 github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
 github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
-github.com/iancoleman/orderedmap v0.2.0 h1:sq1N/TFpYH++aViPcaKjys3bDClUEU7s5B+z6jq8pNA=
-github.com/iancoleman/orderedmap v0.2.0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA=
+github.com/iancoleman/orderedmap v0.3.0 h1:5cbR2grmZR/DiVt+VJopEhtVs9YGInGIxAoMJn+Ichc=
+github.com/iancoleman/orderedmap v0.3.0/go.mod h1:XuLcCUkdL5owUCQeF2Ue9uuw1EptkJDkXXS7VoV7XGE=
 github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
 github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
 github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
@@ -31,10 +31,10 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
 github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
 github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
 github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
-github.com/swaggest/assertjson v1.8.0 h1:XSg4p6iOZMjtpV2tW2SXfD1GsOOTsWcm+sOADODu/DU=
-github.com/swaggest/assertjson v1.8.0/go.mod h1:/8kNRmDZAZfavS5VeWYtCimLGebn0Ak1/iErFUi+DEM=
-github.com/swaggest/jsonschema-go v0.3.50 h1:XbEV23CLRl3dq+QyLiAiP7ieJ9+ccc0kciHs7N4iXJc=
-github.com/swaggest/jsonschema-go v0.3.50/go.mod h1:QfUB5HaZ8y5TiFtCPhM7QwvPNKxTsYxDJaLHTLq6jgU=
+github.com/swaggest/assertjson v1.9.0 h1:dKu0BfJkIxv/xe//mkCrK5yZbs79jL7OVf9Ija7o2xQ=
+github.com/swaggest/assertjson v1.9.0/go.mod h1:b+ZKX2VRiUjxfUIal0HDN85W0nHPAYUbYH5WkkSsFsU=
+github.com/swaggest/jsonschema-go v0.3.52 h1:cFk0Ma34MuZvA+JJ8S5WuQMedwxzUa+9+qrGwtoE39U=
+github.com/swaggest/jsonschema-go v0.3.52/go.mod h1:sRly7iaIIvbheAqsyvnKU3H7ogWbF0wtUBXyGpRXNm4=
 github.com/swaggest/refl v1.1.0 h1:a+9a75Kv6ciMozPjVbOfcVTEQe81t2R3emvaD9oGQGc=
 github.com/swaggest/refl v1.1.0/go.mod h1:g3Qa6ki0A/L2yxiuUpT+cuBURuRaltF5SDQpg1kMZSY=
 github.com/yudai/gojsondiff v1.0.0 h1:27cbfqXLVEJ1o8I6v3y9lg8Ydm53EKqHXAOMxEGlCOA=


Test patch:
diff --git a/.github/workflows/test-unit.yml b/.github/workflows/test-unit.yml
index 87b5f9e..8212660 100644
--- a/.github/workflows/test-unit.yml
+++ b/.github/workflows/test-unit.yml
@@ -26,7 +26,7 @@ jobs:
     steps:
       - name: Install Go stable
         if: matrix.go-version != 'tip'
-        uses: actions/setup-go@v3
+        uses: actions/setup-go@v4
         with:
           go-version: ${{ matrix.go-version }}
 
@@ -41,10 +41,10 @@ jobs:
           echo "PATH=$HOME/go/bin:$HOME/sdk/gotip/bin/:$PATH" >> $GITHUB_ENV
 
       - name: Checkout code
-        uses: actions/checkout@v2
+        uses: actions/checkout@v3
 
       - name: Go cache
-        uses: actions/cache@v2
+        uses: actions/cache@v3
         with:
           # In order:
           # * Module download cache
diff --git a/openapi3/reflect_test.go b/openapi3/reflect_test.go
index bcee560..845dc85 100644
--- a/openapi3/reflect_test.go
+++ b/openapi3/reflect_test.go
@@ -1,8 +1,6 @@
 package openapi3_test
 
 import (
-	"encoding/json"
-	"io/ioutil"
 	"mime/multipart"
 	"net/http"
 	"os"
@@ -109,9 +107,9 @@ func TestReflector_SetRequest_array(t *testing.T) {
 	b, err := assertjson.MarshalIndentCompact(s, "", " ", 120)
 	assert.NoError(t, err)
 
-	require.NoError(t, ioutil.WriteFile("_testdata/openapi_req_array_last_run.json", b, 0o600))
+	require.NoError(t, os.WriteFile("_testdata/openapi_req_array_last_run.json", b, 0o600))
 
-	expected, err := ioutil.ReadFile("_testdata/openapi_req_array.json")
+	expected, err := os.ReadFile("_testdata/openapi_req_array.json")
 	require.NoError(t, err)
 
 	assertjson.Equal(t, expected, b)
@@ -131,7 +129,7 @@ func TestReflector_SetRequest_uploadInterface(t *testing.T) {
 
 	require.NoError(t, s.AddOperation(http.MethodPost, "/somewhere", op))
 
-	assertjson.EqualMarshal(t, []byte(`{
+	assertjson.EqMarshal(t, `{
 	  "openapi":"3.0.3","info":{"title":"","version":""},
 	  "paths":{
 		"/somewhere":{
@@ -154,7 +152,7 @@ func TestReflector_SetRequest_uploadInterface(t *testing.T) {
 		  }
 		}
 	  }
-	}`), s)
+	}`, s)
 }
 
 func TestReflector_SetRequest(t *testing.T) {
@@ -174,9 +172,9 @@ func TestReflector_SetRequest(t *testing.T) {
 	b, err := assertjson.MarshalIndentCompact(s, "", " ", 120)
 	assert.NoError(t, err)
 
-	require.NoError(t, ioutil.WriteFile("_testdata/openapi_req_last_run.json", b, 0o600))
+	require.NoError(t, os.WriteFile("_testdata/openapi_req_last_run.json", b, 0o600))
 
-	expected, err := ioutil.ReadFile("_testdata/openapi_req.json")
+	expected, err := os.ReadFile("_testdata/openapi_req.json")
 	require.NoError(t, err)
 
 	assertjson.Equal(t, expected, b)
@@ -222,29 +220,26 @@ func TestReflector_SetJSONResponse(t *testing.T) {
 	jsb, err := assertjson.MarshalIndentCompact(js, "", " ", 120)
 	require.NoError(t, err)
 
-	require.NoError(t, ioutil.WriteFile("_testdata/resp_schema_last_run.json", jsb, 0o600))
+	require.NoError(t, os.WriteFile("_testdata/resp_schema_last_run.json", jsb, 0o600))
 
-	expected, err = ioutil.ReadFile("_testdata/resp_schema.json")
+	expected, err = os.ReadFile("_testdata/resp_schema.json")
 	require.NoError(t, err)
-	assertjson.Equal(t, expected, jsb, string(jsb))
+	assertjson.EqualMarshal(t, expected, js)
 
 	js = op.Responses.MapOfResponseOrRefValues[strconv.Itoa(http.StatusOK)].Response.Headers["X-Header-Field"].Header.
 		Schema.ToJSONSchema(s)
-	jsb, err = json.Marshal(js)
-	require.NoError(t, err)
-	assertjson.Equal(t, []byte(`{"type": "string", "description": "Sample header response."}`), jsb)
+	assertjson.EqMarshal(t, `{"type": "string", "description": "Sample header response."}`, js)
 
-	js = op.Parameters[0].Parameter.Schema.ToJSONSchema(s)
-	jsb, err = json.Marshal(js)
 	require.NoError(t, err)
-	assertjson.Equal(t, []byte(`{"type": "integer", "description": "Query parameter."}`), jsb)
+	assertjson.EqMarshal(t, `{"type": "integer", "description": "Query parameter."}`,
+		op.Parameters[0].Parameter.Schema.ToJSONSchema(s))
 
 	b, err := assertjson.MarshalIndentCompact(s, "", " ", 120)
 	assert.NoError(t, err)
 
-	require.NoError(t, ioutil.WriteFile("_testdata/openapi_last_run.json", b, 0o600))
+	require.NoError(t, os.WriteFile("_testdata/openapi_last_run.json", b, 0o600))
 
-	expected, err = ioutil.ReadFile("_testdata/openapi.json")
+	expected, err = os.ReadFile("_testdata/openapi.json")
 	require.NoError(t, err)
 
 	assertjson.EqualMarshal(t, expected, s)
@@ -273,10 +268,7 @@ func TestReflector_SetRequest_pathParamAndBody(t *testing.T) {
 	s.Info.Version = apiVersion
 	assert.NoError(t, s.AddOperation(http.MethodPost, "/somewhere/{id}", op))
 
-	b, err := assertjson.MarshalIndentCompact(s, "", " ", 100)
-	assert.NoError(t, err)
-
-	expected := []byte(`{
+	assertjson.EqMarshal(t, `{
 	 "openapi":"3.0.3","info":{"title":"SampleAPI","version":"1.2.3"},
 	 "paths":{
 	  "/somewhere/{id}":{
@@ -292,9 +284,7 @@ func TestReflector_SetRequest_pathParamAndBody(t *testing.T) {
 	 "components":{
 	  "schemas":{"Openapi3TestPathParamAndBody":{"type":"array","items":{"type":"string"},"nullable":true}}
 	 }
-	}`)
-
-	assertjson.Equal(t, expected, b, string(b))
+	}`, s)
 }
 
 type WithReqBody PathParamAndBody
@@ -313,10 +303,7 @@ func TestRequestBodyEnforcer(t *testing.T) {
 	s.Info.Version = apiVersion
 	assert.NoError(t, s.AddOperation(http.MethodGet, "/somewhere/{id}", op))
 
-	b, err := assertjson.MarshalIndentCompact(s, "", " ", 120)
-	assert.NoError(t, err)
-
-	expected := []byte(`{
+	assertjson.EqMarshal(t, `{
 	 "openapi":"3.0.3","info":{"title":"SampleAPI","version":"1.2.3"},
 	 "paths":{
 	  "/somewhere/{id}":{
@@ -328,9 +315,7 @@ func TestRequestBodyEnforcer(t *testing.T) {
 	  }
 	 },
 	 "components":{"schemas":{"Openapi3TestWithReqBody":{"type":"array","items":{"type":"string"},"nullable":true}}}
-	}`)
-
-	assertjson.Equal(t, expected, b, string(b))
+	}`, s)
 }
 
 func TestReflector_SetupResponse(t *testing.T) {
@@ -356,10 +341,7 @@ func TestReflector_SetupResponse(t *testing.T) {
 	}))
 	require.NoError(t, s.AddOperation(http.MethodGet, "/somewhere", op))
 
-	b, err := assertjson.MarshalIndentCompact(s, "", " ", 120)
-	assert.NoError(t, err)
-
-	expected := []byte(`{
+	assertjson.EqMarshal(t, `{
 	 "openapi":"3.0.3","info":{"title":"SampleAPI","version":"1.2.3"},
 	 "paths":{
 	  "/somewhere":{
@@ -377,9 +359,7 @@ func TestReflector_SetupResponse(t *testing.T) {
 	   }
 	  }
 	 }
-	}`)
-
-	assertjson.Equal(t, expected, b, string(b))
+	}`, s)
 }
 
 func TestReflector_SetupRequest(t *testing.T) {
@@ -420,10 +400,7 @@ func TestReflector_SetupRequest(t *testing.T) {
 	}))
 	require.NoError(t, s.AddOperation(http.MethodPost, "/somewhere/{value-4}", op))
 
-	b, err := assertjson.MarshalIndentCompact(s, "", " ", 120)
-	assert.NoError(t, err)
-
-	expected := []byte(`{
+	assertjson.EqMarshal(t, `{
 	 "openapi":"3.0.3","info":{"title":"SampleAPI","version":"1.2.3"},
 	 "paths":{
 	  "/somewhere/{value-4}":{
@@ -449,9 +426,7 @@ func TestReflector_SetupRequest(t *testing.T) {
 	  }
 	 },
 	 "components":{"schemas":{"FormDataMultipartFile":{"type":"string","format":"binary","nullable":true}}}
-	}`)
-
-	assertjson.Equal(t, expected, b, string(b))
+	}`, s)
 }
 
 func TestReflector_SetupRequest_queryObject(t *testing.T) {
@@ -471,10 +446,7 @@ func TestReflector_SetupRequest_queryObject(t *testing.T) {
 	}))
 	require.NoError(t, s.AddOperation(http.MethodPost, "/somewhere", op))
 
-	b, err := assertjson.MarshalIndentCompact(s, "", " ", 120)
-	assert.NoError(t, err)
-
-	expected := []byte(`{
+	assertjson.EqMarshal(t, `{
 	 "openapi":"3.0.3","info":{"title":"SampleAPI","version":"1.2.3"},
 	 "paths":{
 	  "/somewhere":{
@@ -489,9 +461,7 @@ func TestReflector_SetupRequest_queryObject(t *testing.T) {
 	   }
 	  }
 	 }
-	}`)
-
-	assertjson.Equal(t, expected, b, string(b))
+	}`, s)
 }
 
 type namedType struct {
@@ -515,10 +485,7 @@ func TestReflector_SetupRequest_queryNamedObject(t *testing.T) {
 	}))
 	require.NoError(t, s.AddOperation(http.MethodPost, "/somewhere", op))
 
-	b, err := assertjson.MarshalIndentCompact(s, "", " ", 100)
-	assert.NoError(t, err)
-
-	expected := []byte(`{
+	assertjson.EqMarshal(t, `{
 	 "openapi":"3.0.3","info":{"title":"SampleAPI","version":"1.2.3"},
 	 "paths":{
 	  "/somewhere":{
@@ -536,13 +503,11 @@ func TestReflector_SetupRequest_queryNamedObject(t *testing.T) {
 	 "components":{
 	  "schemas":{"Openapi3TestLabels":{"type":"object","additionalProperties":{"type":"number"}}}
 	 }
-	}`)
-
-	assertjson.Equal(t, expected, b, string(b))
+	}`, s)
 
 	js, found := reflector.ResolveJSONSchemaRef("#/components/schemas/Openapi3TestLabels")
 	assert.True(t, found)
-	assertjson.EqualMarshal(t, []byte(`{"type":"object","additionalProperties":{"type":"number"}}`), js)
+	assertjson.EqMarshal(t, `{"type":"object","additionalProperties":{"type":"number"}}`, js)
 }
 
 func TestReflector_SetupRequest_jsonQuery(t *testing.T) {
@@ -566,7 +531,7 @@ func TestReflector_SetupRequest_jsonQuery(t *testing.T) {
 	require.NoError(t, r.SetupRequest(oc))
 	require.NoError(t, r.SpecEns().AddOperation(http.MethodGet, "/", *oc.Operation))
 
-	assertjson.EqualMarshal(t, []byte(`{
+	assertjson.EqMarshal(t, `{
 	  "openapi":"3.0.3","info":{"title":"","version":""},
 	  "paths":{
 		"/":{
@@ -604,7 +569,7 @@ func TestReflector_SetupRequest_jsonQuery(t *testing.T) {
 		  }
 		}
 	  }
-	}`), r.SpecEns())
+	}`, r.SpecEns())
 }
 
 func TestReflector_SetupRequest_forbidParams(t *testing.T) {
@@ -626,7 +591,7 @@ func TestReflector_SetupRequest_forbidParams(t *testing.T) {
 	require.NoError(t, r.SetupRequest(oc))
 	require.NoError(t, r.SpecEns().AddOperation(http.MethodGet, "/{path}", *oc.Operation))
 
-	assertjson.EqualMarshal(t, []byte(`{
+	assertjson.EqMarshal(t, `{
 	  "openapi":"3.0.3","info":{"title":"","version":""},
 	  "paths":{
 		"/{path}":{
@@ -645,7 +610,7 @@ func TestReflector_SetupRequest_forbidParams(t *testing.T) {
 		  }
 		}
 	  }
-	}`), r.SpecEns())
+	}`, r.SpecEns())
 
 	assert.True(t, oc.Operation.UnknownParamIsForbidden(openapi3.ParameterInCookie))
 	assert.False(t, oc.Operation.UnknownParamIsForbidden(openapi3.ParameterInHeader))
@@ -668,10 +633,10 @@ func TestReflector_SetupRequest_noBody(t *testing.T) {
 		}
 
 		require.NoError(t, r.SetupRequest(oc))
-		assertjson.EqualMarshal(t, []byte(`{
+		assertjson.EqMarshal(t, `{
 		  "parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],
 		  "responses":{}
-		}`), oc.Operation)
+		}`, oc.Operation)
 	}
 
 	for _, method := range []string{http.MethodPost, http.MethodPatch, http.MethodPut} {
@@ -682,7 +647,7 @@ func TestReflector_SetupRequest_noBody(t *testing.T) {
 		}
 
 		require.NoError(t, r.SetupRequest(oc))
-		assertjson.EqualMarshal(t, []byte(`{
+		assertjson.EqMarshal(t, `{
 		  "parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],
 		  "requestBody":{
 			"content":{
@@ -690,7 +655,7 @@ func TestReflector_SetupRequest_noBody(t *testing.T) {
 			}
 		  },
 		  "responses":{}
-		}`), oc.Operation)
+		}`, oc.Operation)
 	}
 }
 
@@ -786,7 +751,7 @@ func TestReflector_SetRequest_formData_with_json(t *testing.T) {
 	require.NoError(t, r.SetupRequest(oc))
 	require.NoError(t, r.SpecEns().AddOperation(http.MethodGet, "/foo", *oc.Operation))
 
-	assertjson.EqualMarshal(t, []byte(`{
+	assertjson.EqMarshal(t, `{
 	  "openapi":"3.0.3","info":{"title":"","version":""},
 	  "paths":{
 		"/foo":{
@@ -805,7 +770,7 @@ func TestReflector_SetRequest_formData_with_json(t *testing.T) {
 		  "FormDataOpenapi3TestReq":{"type":"object","properties":{"foo":{"type":"integer"}}}
 		}
 	  }
-	}`), r.SpecEns())
+	}`, r.SpecEns())
 }
 
 func TestReflector_SetupRequest_form(t *testing.T) {
@@ -826,7 +791,7 @@ func TestReflector_SetupRequest_form(t *testing.T) {
 	require.NoError(t, r.SetupRequest(oc))
 	require.NoError(t, r.SpecEns().AddOperation(http.MethodPost, "/foo", *oc.Operation))
 
-	assertjson.EqualMarshal(t, []byte(`{
+	assertjson.EqMarshal(t, `{
 	  "openapi":"3.0.3","info":{"title":"","version":""},
 	  "paths":{
 		"/foo":{
@@ -856,7 +821,7 @@ func TestReflector_SetupRequest_form(t *testing.T) {
 		  }
 		}
 	  }
-	}`), r.SpecEns())
+	}`, r.SpecEns())
 }
 
 func TestReflector_SetupRequest_form_only(t *testing.T) {
@@ -875,7 +840,7 @@ func TestReflector_SetupRequest_form_only(t *testing.T) {
 	require.NoError(t, r.SetupRequest(oc))
 	require.NoError(t, r.SpecEns().AddOperation(http.MethodPost, "/foo", *oc.Operation))
 
-	assertjson.EqualMarshal(t, []byte(`{
+	assertjson.EqMarshal(t, `{
 	  "openapi":"3.0.3","info":{"title":"","version":""},
 	  "paths":{
 		"/foo":{
@@ -901,7 +866,7 @@ func TestReflector_SetupRequest_form_only(t *testing.T) {
 		  }
 		}
 	  }
-	}`), r.SpecEns())
+	}`, r.SpecEns())
 }
 
 func TestReflector_SetRequest_queryObject(t *testing.T) {
@@ -950,7 +915,7 @@ func TestReflector_SetRequest_queryObject(t *testing.T) {
 	handleError(reflector.SetRequest(&getOp, new(req), http.MethodGet))
 	handleError(reflector.Spec.AddOperation(http.MethodGet, "/things/{id}", getOp))
 
-	assertjson.EqualMarshal(t, []byte(`{
+	assertjson.EqMarshal(t, `{
 	  "openapi":"3.0.3","info":{"title":"","version":""},
 	  "paths":{
 		"/things/{id}":{
@@ -1003,5 +968,5 @@ func TestReflector_SetRequest_queryObject(t *testing.T) {
 		  }
 		}
 	  }
-	}`), reflector.Spec)
+	}`, reflector.Spec)
 }