Skip to content

Commit 5672baa

Browse files
[azeventgrid] Removing the empty Interface any from PublishCloudEventsResponse (Azure#21081)
- Addressing some of the API feedback. - Removing the `Interface any` from the generated code for an empty response. - Making our env variable just line up with the common convention for writing out the ephemeral key. Still only available for our tests.
1 parent 2231bfe commit 5672baa

File tree

5 files changed

+11
-20
lines changed

5 files changed

+11
-20
lines changed

sdk/messaging/azeventgrid/autorest.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ go: true
99
input-file:
1010
# This was the commit that everyone used to generate their first official betas.
1111
- https://raw.githubusercontent.com/Azure/azure-rest-api-specs/947c9ce9b20900c6cbc8e95bc083e723d09a9c2c/specification/eventgrid/data-plane/Microsoft.EventGrid/preview/2023-06-01-preview/EventGrid.json
12-
# when we start using the .tsp file directly we can start referring to the compiled output.
13-
# ./tsp-output\@azure-tools\typespec-autorest\2023-06-01-preview\openapi.json
1412
license-header: MICROSOFT_MIT_NO_VERSION
1513
module: github.com/Azure/azure-sdk-for-go/sdk/messaging/azeventgrid
1614
openapi-type: "data-plane"
@@ -65,4 +63,10 @@ directive:
6563
- response_types.go
6664
where: $
6765
transform: return $.replace(/\*CloudEvent/g, "messaging.CloudEvent");
66+
67+
# remove the 'Interface any' that's generated for an empty response object.
68+
- from:
69+
- swagger-document
70+
where: $["x-ms-paths"]["/topics/{topicName}:publish?api-version={apiVersion}"].post.responses["200"]
71+
transform: delete $["schema"];
6872
```

sdk/messaging/azeventgrid/client.go

Lines changed: 1 addition & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/messaging/azeventgrid/client_test.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,9 @@ func TestFailedAck(t *testing.T) {
2525
ce, err := messaging.NewCloudEvent("hello-source", "world", []byte("ack this one"), nil)
2626
require.NoError(t, err)
2727

28-
pubResp, err := c.PublishCloudEvents(context.Background(), c.TestVars.Topic, []messaging.CloudEvent{ce}, nil)
28+
_, err = c.PublishCloudEvents(context.Background(), c.TestVars.Topic, []messaging.CloudEvent{ce}, nil)
2929
require.NoError(t, err)
3030

31-
// just documenting this, I don't think the return value is useful.
32-
require.Equal(t, map[string]interface{}{}, pubResp.Interface)
33-
3431
recvResp, err := c.ReceiveCloudEvents(context.Background(), c.TestVars.Topic, c.TestVars.Subscription, &azeventgrid.ReceiveCloudEventsOptions{
3532
MaxEvents: to.Ptr[int32](1),
3633
MaxWaitTime: to.Ptr[int32](10),

sdk/messaging/azeventgrid/response_types.go

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/messaging/azeventgrid/shared_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ func loadEnv() (testVars, error) {
6969
// Setting this variable will cause the test clients to dump out the pre-master-key
7070
// for your HTTP connection. This allows you decrypt a packet capture from wireshark.
7171
//
72-
// If you want to do this just set SSLKEYLOGFILE_TEST env var to a path on disk and
72+
// If you want to do this just set SSLKEYLOGFILE env var to a path on disk and
7373
// Go will write out the key.
74-
tv.KeyLogPath = os.Getenv("SSLKEYLOGFILE_TEST")
74+
tv.KeyLogPath = os.Getenv("SSLKEYLOGFILE")
7575
return tv, nil
7676
}
7777

0 commit comments

Comments
 (0)