Skip to content

Commit ceed0bd

Browse files
committed
chore: remove MinRetry and MaxRetry from RequestOptions
1 parent 242e239 commit ceed0bd

File tree

4 files changed

+8
-32
lines changed

4 files changed

+8
-32
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
- feat: add support for custom headers per request
66
- feat: add contextual tuples support in Expand requests
77

8+
> [!WARNING]
9+
> BREAKING CHANGES:
10+
> This unreleased version contains a breaking change around `client.RequestOptions` - no longer accepting `MinRetry` and `MaxRetry` fields - they will be re-added before the next release.
11+
812
## v0.7.1
913

1014
### [0.7.1](https://github.com/openfga/go-sdk/compare/v0.7.0...v0.7.1) (2025-04-07)

api_headers_test.go

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -71,28 +71,16 @@ func TestAPIRequestOptionsStructure(t *testing.T) {
7171
Headers: map[string]string{
7272
"Test-Header": "test-value",
7373
},
74-
MaxRetry: openfga.PtrInt(3),
75-
MinWaitInMs: openfga.PtrInt(1000),
7674
}
7775

7876
if options.Headers["Test-Header"] != "test-value" {
7977
t.Errorf("Expected Test-Header to be 'test-value', got '%s'", options.Headers["Test-Header"])
8078
}
81-
82-
if options.MaxRetry == nil || *options.MaxRetry != 3 {
83-
t.Errorf("Expected MaxRetry to be 3, got %v", options.MaxRetry)
84-
}
85-
86-
if options.MinWaitInMs == nil || *options.MinWaitInMs != 1000 {
87-
t.Errorf("Expected MinWaitInMs to be 1000, got %v", options.MinWaitInMs)
88-
}
8979
})
9080

9181
t.Run("RequestOptionsWithNilHeaders", func(t *testing.T) {
9282
options := openfga.RequestOptions{
93-
Headers: nil,
94-
MaxRetry: openfga.PtrInt(3),
95-
MinWaitInMs: openfga.PtrInt(1000),
83+
Headers: nil,
9684
}
9785

9886
if options.Headers != nil {
@@ -102,9 +90,7 @@ func TestAPIRequestOptionsStructure(t *testing.T) {
10290

10391
t.Run("RequestOptionsWithEmptyHeaders", func(t *testing.T) {
10492
options := openfga.RequestOptions{
105-
Headers: map[string]string{},
106-
MaxRetry: openfga.PtrInt(3),
107-
MinWaitInMs: openfga.PtrInt(1000),
93+
Headers: map[string]string{},
10894
}
10995

11096
if len(options.Headers) != 0 {

api_open_fga.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ var (
3333
)
3434

3535
type RequestOptions struct {
36-
MaxRetry *int `json:"max_retry,omitempty"`
37-
MinWaitInMs *int `json:"min_wait_in_ms,omitempty"`
38-
Headers map[string]string `json:"headers,omitempty"`
36+
Headers map[string]string `json:"headers,omitempty"`
3937
}
4038

4139
type OpenFgaApi interface {

client/client_headers_test.go

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ func TestRequestOptionsStructure(t *testing.T) {
7474
Headers: map[string]string{
7575
testHeaderName: testHeaderValue,
7676
},
77-
MaxRetry: fgaSdk.PtrInt(3),
78-
MinWaitInMs: fgaSdk.PtrInt(1000),
7977
},
8078
AuthorizationModelId: fgaSdk.PtrString("01H0H015178Y2V4CX10C2KGHF4"),
8179
Consistency: nil,
@@ -85,14 +83,6 @@ func TestRequestOptionsStructure(t *testing.T) {
8583
t.Errorf("Expected %s to be '%s', got '%s'", testHeaderName, testHeaderValue, options.Headers[testHeaderName])
8684
}
8785

88-
if options.MaxRetry == nil || *options.MaxRetry != 3 {
89-
t.Errorf("Expected MaxRetry to be 3, got %v", options.MaxRetry)
90-
}
91-
92-
if options.MinWaitInMs == nil || *options.MinWaitInMs != 1000 {
93-
t.Errorf("Expected MinWaitInMs to be 1000, got %v", options.MinWaitInMs)
94-
}
95-
9686
if options.AuthorizationModelId == nil || *options.AuthorizationModelId != "01H0H015178Y2V4CX10C2KGHF4" {
9787
t.Errorf("Expected AuthorizationModelId to be set correctly")
9888
}
@@ -101,9 +91,7 @@ func TestRequestOptionsStructure(t *testing.T) {
10191
t.Run("RequestWithNilHeaders", func(t *testing.T) {
10292
options := fgaSdkClient.ClientCheckOptions{
10393
RequestOptions: fgaSdkClient.RequestOptions{
104-
Headers: nil,
105-
MaxRetry: fgaSdk.PtrInt(3),
106-
MinWaitInMs: fgaSdk.PtrInt(1000),
94+
Headers: nil,
10795
},
10896
}
10997

0 commit comments

Comments
 (0)