Skip to content

Commit 4897c8b

Browse files
authored
Fix Go SDK for cognitiveservices/anomalydetector (#5686)
This endpoint requires client-side TLS renegotiation to be enabled. Add a directive to modify the codegen to enable renegotiation.
1 parent fc11c04 commit 4897c8b

File tree

1 file changed

+10
-1
lines changed
  • specification/cognitiveservices/data-plane/AnomalyDetector

1 file changed

+10
-1
lines changed

specification/cognitiveservices/data-plane/AnomalyDetector/readme.go.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ go:
77
license-header: MICROSOFT_APACHE_NO_VERSION
88
namespace: anomalydetector
99
clear-output-folder: true
10+
11+
directive:
12+
# Replace the default client constructor with the one that enables TLS renegotiation.
13+
- from: client.go
14+
where: $
15+
transform: >-
16+
return $.
17+
replace( /"context"/g, "\"context\"\n\"crypto/tls\"" ).
18+
replace( /autorest\.NewClientWithUserAgent\(UserAgent\(\)\)/g, "autorest.NewClientWithOptions(autorest.ClientOptions{UserAgent: UserAgent(), Renegotiation: tls.RenegotiateFreelyAsClient})" )
1019
```
1120
1221
### Go multi-api
@@ -23,4 +32,4 @@ Please also specify `--go-sdk-folder=<path to the root directory of your azure-s
2332

2433
``` yaml $(tag) == 'release_1_0' && $(go)
2534
output-folder: $(go-sdk-folder)/services/preview/cognitiveservices/v1.0/$(namespace)
26-
```
35+
```

0 commit comments

Comments
 (0)