Skip to content

Commit 94cca5a

Browse files
api-clients-generation-pipeline[bot]charlie-zhang109claudeci.datadog-api-spec
authored
Set x-keep-typed-in-additional-properties on UsageSummary schemas (#3693)
* Support x-keep-typed-in-additional-properties in Python model generator When a schema sets `x-keep-typed-in-additional-properties: true`, emit a `_keep_typed_in_additional_properties = True` class attribute. In Python all fields are already stored in `_data_store` and accessible via `model["key"]` regardless of type; this marker makes the intent explicit for tooling. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * docs: annotate _keep_typed_in_additional_properties as a cross-SDK semantic marker In Python, typed fields are already reachable via bracket notation through _data_store, so no runtime behaviour change is required. The marker makes the flag visible for introspection and aligns semantics with other language SDKs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * Regenerate client from commit 3677df7 of spec repo --------- Co-authored-by: Charlie Zhang <charlie.zhang@datadoghq.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent ade1bf6 commit 94cca5a

5 files changed

Lines changed: 20 additions & 0 deletions

File tree

.generator/schemas/v1/openapi.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24110,6 +24110,7 @@ components:
2411024110
format: int64
2411124111
type: integer
2411224112
type: object
24113+
x-keep-typed-in-additional-properties: true
2411324114
UsageSummaryDateOrg:
2411424115
description: |-
2411524116
Global hourly report of all data billed by Datadog for a given organization.
@@ -25429,6 +25430,7 @@ components:
2542925430
format: int64
2543025431
type: integer
2543125432
type: object
25433+
x-keep-typed-in-additional-properties: true
2543225434
UsageSummaryResponse:
2543325435
description: |-
2543425436
Response summarizing all usage aggregated across the months in the request for
@@ -26776,6 +26778,7 @@ components:
2677626778
format: int64
2677726779
type: integer
2677826780
type: object
26781+
x-keep-typed-in-additional-properties: true
2677926782
UsageSyntheticsAPIHour:
2678026783
description: Number of Synthetics API tests run for each hour for a given organization.
2678126784
properties:

.generator/src/generator/templates/model_generic.j2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ class {{ name }}(ModelNormal):
7474
{%- if model.nullable %}
7575
_nullable = True
7676
{%- endif %}
77+
{%- if model.get("x-keep-typed-in-additional-properties") %}
78+
# Cross-SDK semantic marker. In Python, typed fields are already accessible via
79+
# bracket notation (model["key"]) through _data_store, so no runtime change is needed.
80+
_keep_typed_in_additional_properties = True
81+
{%- endif %}
7782

7883
{%- if model.properties %}
7984
@cached_property

src/datadog_api_client/v1/model/usage_summary_date.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919

2020

2121
class UsageSummaryDate(ModelNormal):
22+
# Cross-SDK semantic marker. In Python, typed fields are already accessible via
23+
# bracket notation (model["key"]) through _data_store, so no runtime change is needed.
24+
_keep_typed_in_additional_properties = True
25+
2226
@cached_property
2327
def openapi_types(_):
2428
from datadog_api_client.v1.model.usage_summary_date_org import UsageSummaryDateOrg

src/datadog_api_client/v1/model/usage_summary_date_org.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414

1515

1616
class UsageSummaryDateOrg(ModelNormal):
17+
# Cross-SDK semantic marker. In Python, typed fields are already accessible via
18+
# bracket notation (model["key"]) through _data_store, so no runtime change is needed.
19+
_keep_typed_in_additional_properties = True
20+
1721
@cached_property
1822
def openapi_types(_):
1923
return {

src/datadog_api_client/v1/model/usage_summary_response.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020

2121

2222
class UsageSummaryResponse(ModelNormal):
23+
# Cross-SDK semantic marker. In Python, typed fields are already accessible via
24+
# bracket notation (model["key"]) through _data_store, so no runtime change is needed.
25+
_keep_typed_in_additional_properties = True
26+
2327
@cached_property
2428
def openapi_types(_):
2529
from datadog_api_client.v1.model.logs_by_retention import LogsByRetention

0 commit comments

Comments
 (0)