Skip to content

Commit 0be09d5

Browse files
committed
CLEANUP/MINOR: resolve swag deprecating functions
1 parent 44a59aa commit 0be09d5

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

crs/api/ingress/v1/tcp.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
package v1
1717

1818
import (
19-
"github.com/go-openapi/swag"
19+
"github.com/go-openapi/swag/jsonutils"
2020
"github.com/haproxytech/client-native/v5/models"
2121
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2222
)
@@ -161,13 +161,13 @@ func (s *TCPService) MarshalBinary() ([]byte, error) {
161161
if s == nil {
162162
return nil, nil
163163
}
164-
return swag.WriteJSON(s)
164+
return jsonutils.WriteJSON(s)
165165
}
166166

167167
// UnmarshalBinary interface implementation
168168
func (s *TCPService) UnmarshalBinary(b []byte) error {
169169
var res TCPService
170-
if err := swag.ReadJSON(b, &res); err != nil {
170+
if err := jsonutils.ReadJSON(b, &res); err != nil {
171171
return err
172172
}
173173
*s = res

crs/api/ingress/v3/tcp.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
package v3
1717

1818
import (
19-
"github.com/go-openapi/swag"
19+
"github.com/go-openapi/swag/jsonutils"
2020
"github.com/haproxytech/client-native/v6/models"
2121
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2222
)
@@ -87,13 +87,13 @@ func (s *TCPService) MarshalBinary() ([]byte, error) {
8787
if s == nil {
8888
return nil, nil
8989
}
90-
return swag.WriteJSON(s)
90+
return jsonutils.WriteJSON(s)
9191
}
9292

9393
// UnmarshalBinary interface implementation
9494
func (s *TCPService) UnmarshalBinary(b []byte) error {
9595
var res TCPService
96-
if err := swag.ReadJSON(b, &res); err != nil {
96+
if err := jsonutils.ReadJSON(b, &res); err != nil {
9797
return err
9898
}
9999
*s = res

crs/api/ingress/v3/validation-rules.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
package v3
1717

1818
import (
19-
"github.com/go-openapi/swag"
19+
"github.com/go-openapi/swag/jsonutils"
2020
"github.com/haproxytech/kubernetes-ingress/pkg/annotations/validators"
2121
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2222
)
@@ -51,13 +51,13 @@ func (m *ValidationRulesSpec) MarshalBinary() ([]byte, error) {
5151
if m == nil {
5252
return nil, nil
5353
}
54-
return swag.WriteJSON(m)
54+
return jsonutils.WriteJSON(m)
5555
}
5656

5757
// UnmarshalBinary interface implementation
5858
func (m *ValidationRulesSpec) UnmarshalBinary(b []byte) error {
5959
var res ValidationRulesSpec
60-
if err := swag.ReadJSON(b, &res); err != nil {
60+
if err := jsonutils.ReadJSON(b, &res); err != nil {
6161
return err
6262
}
6363
*m = res

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ require (
77
github.com/Masterminds/semver/v3 v3.3.1
88
github.com/brianvoe/gofakeit/v7 v7.2.1
99
github.com/fasthttp/router v1.5.4
10-
github.com/go-openapi/swag v0.25.4
10+
github.com/go-openapi/swag/jsonutils v0.25.4
1111
github.com/go-test/deep v1.1.1
1212
github.com/google/cel-go v0.26.1
1313
github.com/google/go-cmp v0.7.0
@@ -52,11 +52,11 @@ require (
5252
github.com/go-openapi/loads v0.22.0 // indirect
5353
github.com/go-openapi/spec v0.21.0 // indirect
5454
github.com/go-openapi/strfmt v0.23.0 // indirect
55+
github.com/go-openapi/swag v0.25.4 // indirect
5556
github.com/go-openapi/swag/cmdutils v0.25.4 // indirect
5657
github.com/go-openapi/swag/conv v0.25.4 // indirect
5758
github.com/go-openapi/swag/fileutils v0.25.4 // indirect
5859
github.com/go-openapi/swag/jsonname v0.25.4 // indirect
59-
github.com/go-openapi/swag/jsonutils v0.25.4 // indirect
6060
github.com/go-openapi/swag/loading v0.25.4 // indirect
6161
github.com/go-openapi/swag/mangling v0.25.4 // indirect
6262
github.com/go-openapi/swag/netutils v0.25.4 // indirect

0 commit comments

Comments
 (0)