Skip to content

Commit adeab48

Browse files
committed
fix API version
1 parent 93addaa commit adeab48

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.10.0
1+
2.11.0

sdk/sdk.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ type FormalSDK struct {
3737
func New(apiKey string) *FormalSDK {
3838
httpClient := &http.Client{Transport: &transport{
3939
apiKey: apiKey,
40+
apiVersion: "2025-02-24",
4041
underlyingTransport: http.DefaultTransport,
4142
}}
4243
return &FormalSDK{
@@ -67,6 +68,7 @@ func New(apiKey string) *FormalSDK {
6768
func NewWithUrl(apiKey string, url string) *FormalSDK {
6869
httpClient := &http.Client{Transport: &transport{
6970
apiKey: apiKey,
71+
apiVersion: "2025-02-24",
7072
underlyingTransport: http.DefaultTransport,
7173
}}
7274
return &FormalSDK{
@@ -96,10 +98,12 @@ func NewWithUrl(apiKey string, url string) *FormalSDK {
9698

9799
type transport struct {
98100
underlyingTransport http.RoundTripper
101+
apiVersion string
99102
apiKey string
100103
}
101104

102105
func (t *transport) RoundTrip(req *http.Request) (*http.Response, error) {
103106
req.Header.Add("X-Api-Key", t.apiKey)
107+
req.Header.Add("X-Formal-API-Version", t.apiVersion)
104108
return t.underlyingTransport.RoundTrip(req)
105109
}

0 commit comments

Comments
 (0)