Skip to content

[pull] master from DataDog:master#308

Merged
pull[bot] merged 3 commits intoConnectionMaster:masterfrom
DataDog:master
Apr 14, 2026
Merged

[pull] master from DataDog:master#308
pull[bot] merged 3 commits intoConnectionMaster:masterfrom
DataDog:master

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented Apr 14, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

…3883)

Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
#3930)

Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
… nullable map example generation (AAWF-1198) (#3952)

* fix(formatter): handle empty additionalProperties as map[string]interface{}

When `additionalProperties: {}` is set on a schema, Python's truthiness
evaluates the empty dict as falsy, causing the additionalProperties block
to be skipped. The generator then fell through to the nullable path and
emitted `*NewNullableXxx(&Xxx{})` — a constructor that is never generated
for map schemas — resulting in a Go compile error.

Fix the condition to check for the presence of the key and an explicit
`false` value rather than relying on truthiness. When additionalProperties
is an empty dict or boolean `true`, normalize to `interface{}` as the
nested value type and format values inline.

Also remove the now-unreachable dead-code branch that previously handled
`type: object + additionalProperties: {}` after the nullable check.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* pre-commit fixes

* fix(formatter): properly escape values in untyped additionalProperties

When formatting values for untyped additionalProperties (e.g. additionalProperties: {}),
infer the schema from the Python value type so that string escaping, boolean and
number formatting are handled correctly. Previously, the fallback `f'"{v}"'` would
embed raw newlines in Go string literals, causing compile errors for values like
multi-line strings.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* pre-commit fixes

* fix(formatter): use map type for named map schemas in array items

When array items are a $ref to a schema with additionalProperties (and
no properties), schema_name() returned the ref name (e.g.
IDPConfigValueItem) which was used as the Go type — but no struct is
ever generated for map schemas, causing a compile error.

Apply the same additionalProperties != False guard used elsewhere so
that named map schemas resolve to map[string]T instead of the struct
name, consistent with how type_to_go() handles them.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
@pull pull Bot locked and limited conversation to collaborators Apr 14, 2026
@pull pull Bot added the ⤵️ pull label Apr 14, 2026
@pull pull Bot merged commit 064ea68 into ConnectionMaster:master Apr 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant