Skip to content

Commit 0be4339

Browse files
fix: remove null assignment to fix strictNullChecks compile error in ObjectSerializer
baseNameToAttr was conditionally set to null when keepAllInAdditional is false, which fails under strict: true. Always initialize to {} and skip population via the existing keepAllInAdditional guard in the loop body. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent e4344f4 commit 0be4339

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

packages/datadog-api-client-v1/models/ObjectSerializer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3343,7 +3343,7 @@ export class ObjectSerializer {
33433343
// Single pass: build attributesBaseNames (for extra-key detection) and, when needed,
33443344
// baseNameToAttr (for per-field typed deserialization preserving int64 precision).
33453345
const attributesBaseNames: { [key: string]: string } = {};
3346-
const baseNameToAttr: { [key: string]: any } = keepAllInAdditional ? {} : null;
3346+
const baseNameToAttr: { [key: string]: any } = {};
33473347
for (const attrName in attributesMap) {
33483348
const baseName = attributesMap[attrName].baseName;
33493349
attributesBaseNames[baseName] = "";

packages/datadog-api-client-v2/models/ObjectSerializer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14359,7 +14359,7 @@ export class ObjectSerializer {
1435914359
// Single pass: build attributesBaseNames (for extra-key detection) and, when needed,
1436014360
// baseNameToAttr (for per-field typed deserialization preserving int64 precision).
1436114361
const attributesBaseNames: { [key: string]: string } = {};
14362-
const baseNameToAttr: { [key: string]: any } = keepAllInAdditional ? {} : null;
14362+
const baseNameToAttr: { [key: string]: any } = {};
1436314363
for (const attrName in attributesMap) {
1436414364
const baseName = attributesMap[attrName].baseName;
1436514365
attributesBaseNames[baseName] = "";

0 commit comments

Comments
 (0)