Skip to content

Commit a26dd63

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Correct Error Response of Metric Tag Cardinalities Endpoint (#2632)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent b72cf1d commit a26dd63

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

.generated-info

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"spec_repo_commit": "d02c8a3",
3-
"generated": "2025-08-08 12:08:19.964"
2+
"spec_repo_commit": "3a6cb30",
3+
"generated": "2025-08-12 15:42:26.157"
44
}

.generator/schemas/v2/openapi.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55875,25 +55875,25 @@ paths:
5587555875
content:
5587655876
application/json:
5587755877
schema:
55878-
$ref: '#/components/schemas/APIErrorResponse'
55878+
$ref: '#/components/schemas/JSONAPIErrorResponse'
5587955879
description: Bad Request
5588055880
'403':
5588155881
content:
5588255882
application/json:
5588355883
schema:
55884-
$ref: '#/components/schemas/APIErrorResponse'
55884+
$ref: '#/components/schemas/JSONAPIErrorResponse'
5588555885
description: Forbidden
5588655886
'404':
5588755887
content:
5588855888
application/json:
5588955889
schema:
55890-
$ref: '#/components/schemas/APIErrorResponse'
55890+
$ref: '#/components/schemas/JSONAPIErrorResponse'
5589155891
description: Not Found
5589255892
'429':
5589355893
content:
5589455894
application/json:
5589555895
schema:
55896-
$ref: '#/components/schemas/APIErrorResponse'
55896+
$ref: '#/components/schemas/JSONAPIErrorResponse'
5589755897
description: Too Many Requests
5589855898
summary: Get tag key cardinality details
5589955899
tags:

packages/datadog-api-client-v2/apis/MetricsApi.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { ApiException } from "../../datadog-api-client-common/exception";
1818

1919
import { APIErrorResponse } from "../models/APIErrorResponse";
2020
import { IntakePayloadAccepted } from "../models/IntakePayloadAccepted";
21+
import { JSONAPIErrorResponse } from "../models/JSONAPIErrorResponse";
2122
import { MetricAllTagsResponse } from "../models/MetricAllTagsResponse";
2223
import { MetricAssetsResponse } from "../models/MetricAssetsResponse";
2324
import { MetricBulkTagConfigCreateRequest } from "../models/MetricBulkTagConfigCreateRequest";
@@ -1136,20 +1137,23 @@ export class MetricsApiResponseProcessor {
11361137
await response.body.text(),
11371138
contentType
11381139
);
1139-
let body: APIErrorResponse;
1140+
let body: JSONAPIErrorResponse;
11401141
try {
11411142
body = ObjectSerializer.deserialize(
11421143
bodyText,
1143-
"APIErrorResponse"
1144-
) as APIErrorResponse;
1144+
"JSONAPIErrorResponse"
1145+
) as JSONAPIErrorResponse;
11451146
} catch (error) {
11461147
logger.debug(`Got error deserializing error: ${error}`);
1147-
throw new ApiException<APIErrorResponse>(
1148+
throw new ApiException<JSONAPIErrorResponse>(
11481149
response.httpStatusCode,
11491150
bodyText
11501151
);
11511152
}
1152-
throw new ApiException<APIErrorResponse>(response.httpStatusCode, body);
1153+
throw new ApiException<JSONAPIErrorResponse>(
1154+
response.httpStatusCode,
1155+
body
1156+
);
11531157
}
11541158

11551159
// Work around for missing responses in specification, e.g. for petstore.yaml

0 commit comments

Comments
 (0)