Skip to content

Commit

Permalink
fix: update ns_set data type
Browse files Browse the repository at this point in the history
  • Loading branch information
rwhelan committed Oct 2, 2023
1 parent e780797 commit a4735b3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .changelog/1410.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
```release-note:bug
cloudflare: fix incorrect data type in UpdateCustomNameserverZoneMetadataParams struct
custom_nameservers: change `NSSet` from string to int to match API response
```
5 changes: 2 additions & 3 deletions custom_nameservers.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ type CustomNameserverResult struct {
}

type CustomNameserverZoneMetadata struct {
Type string `json:"type"`
NSSet string `json:"ns_set"`
Enabled bool `json:"enabled"`
NSSet int `json:"ns_set"`
Enabled bool `json:"enabled"`
}

type customNameserverListResponse struct {
Expand Down
4 changes: 2 additions & 2 deletions custom_nameservers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ func TestAccountCustomNameserver_GetAccountCustomNameserverZoneMetadata(t *testi
w.Header().Set("content-type", "application/json")
fmt.Fprintf(w, `{
"result": {
"ns_set": "1",
"ns_set": 1,
"enabled": true
},
"success": true,
Expand All @@ -207,7 +207,7 @@ func TestAccountCustomNameserver_GetAccountCustomNameserverZoneMetadata(t *testi

mux.HandleFunc("/zones/"+testZoneID+"/custom_ns", handler)
want := CustomNameserverZoneMetadata{
NSSet: "1",
NSSet: 1,
Enabled: true,
}

Expand Down

0 comments on commit a4735b3

Please sign in to comment.