Skip to content

Commit 5c77811

Browse files
bndbshskarimo
andauthored
sanitize configuration keys correctly (#3143)
* sanitize configuration keys correctly The api template uses class_name, but the config was not. This led to a divergence for On-Call Paging: Usage: https://github.com/DataDog/datadog-api-client-go/blob/31a2b1a4757da7b06ba985bba77b512c5f45224d/api/datadogV2/api_on_call_paging.go#L89 Configuration: https://github.com/DataDog/datadog-api-client-go/blob/31a2b1a4757da7b06ba985bba77b512c5f45224d/api/datadog/configuration.go#L324 * use tags --------- Co-authored-by: Sherzod Karimov <[email protected]>
1 parent d03c737 commit 5c77811

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

.generator/src/generator/templates/configuration.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ func NewConfiguration() *Configuration {
154154
{%- for operation in path.values() %}
155155
{%- for server in operation.servers %}
156156
{%- if loop.first %}
157-
"{{ version }}.{{ operation.tags[0].replace(" ", "") }}Api.{{ operation.operationId }}": {
157+
"{{ version }}.{{ operation.tags[0] | class_name }}.{{ operation.operationId }}": {
158158
{%- endif %}
159159
{{ server_configuration(server)|indent("\t"*4) }},
160160
{%- if loop.last %}

api/datadog/configuration.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ func NewConfiguration() *Configuration {
321321
},
322322
},
323323
},
324-
"v2.On-CallPagingApi.CreateOnCallPage": {
324+
"v2.OnCallPagingApi.CreateOnCallPage": {
325325
{
326326
URL: "https://{site}",
327327
Description: "No description provided",
@@ -368,7 +368,7 @@ func NewConfiguration() *Configuration {
368368
},
369369
},
370370
},
371-
"v2.On-CallPagingApi.AcknowledgeOnCallPage": {
371+
"v2.OnCallPagingApi.AcknowledgeOnCallPage": {
372372
{
373373
URL: "https://{site}",
374374
Description: "No description provided",
@@ -415,7 +415,7 @@ func NewConfiguration() *Configuration {
415415
},
416416
},
417417
},
418-
"v2.On-CallPagingApi.EscalateOnCallPage": {
418+
"v2.OnCallPagingApi.EscalateOnCallPage": {
419419
{
420420
URL: "https://{site}",
421421
Description: "No description provided",
@@ -462,7 +462,7 @@ func NewConfiguration() *Configuration {
462462
},
463463
},
464464
},
465-
"v2.On-CallPagingApi.ResolveOnCallPage": {
465+
"v2.OnCallPagingApi.ResolveOnCallPage": {
466466
{
467467
URL: "https://{site}",
468468
Description: "No description provided",

0 commit comments

Comments
 (0)