Skip to content

Mark list-of-oneOf with an invalid item as unparsed#4078

Open
ddadamhooper wants to merge 4 commits into
masterfrom
adam.hooper/propagate-unparsed
Open

Mark list-of-oneOf with an invalid item as unparsed#4078
ddadamhooper wants to merge 4 commits into
masterfrom
adam.hooper/propagate-unparsed

Conversation

@ddadamhooper

@ddadamhooper ddadamhooper commented Jul 13, 2026

Copy link
Copy Markdown

What does this PR do?

Correctly fails to parse a FormulaAndFunctionEventQueryDefinition when it contains an invalid group_by list entry.

The code generator was failing to propagate unparsed from a oneOf to its parent in this case.

(DataDog's APIs don't generally return invalid objects, so this shouldn't affect users. The value comes with an upcoming PR, where a oneOf item contains a list which contains another oneOf item. In that case, we need to detect invalid objects from the inner oneOf.)

Review checklist

Please check relevant items below:

  • This PR includes all newly recorded cassettes for any modified tests.
  • This PR does not rely on API client schema changes.
    • The CI should be fully passing.
  • Or, this PR relies on API schema changes and this is a Draft PR that includes tests.
    • Note: CI shouldn't be run on this Draft PR, as its expected to fail without the corresponding schema changes.

@ddadamhooper ddadamhooper added the changelog/Fixed Fixed features results into a bug fix version bump label Jul 13, 2026
@ddadamhooper ddadamhooper marked this pull request as ready for review July 13, 2026 18:00
@ddadamhooper ddadamhooper requested review from a team as code owners July 13, 2026 18:00
@ddadamhooper

Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 80fbe0bc2c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jack-edmonds-dd jack-edmonds-dd left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approval for modelSimple.j2 (I'm assuming the rest of the changes are generated).

@ddadamhooper

Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

💡 Codex Review

for ({{ itemsDataType }} item : {{ variableName }}) {

P2 Badge Guard list fluent setters against null

For optional array-of-model fields, this template now makes the generated fluent setter iterate the caller-provided value unconditionally. In generated methods such as FormulaAndFunctionUserJourneyQueryDefinition.groupBy(List<...>), passing null to clear/omit the optional property was previously accepted and is still accepted by the generated setGroupBy, but now throws a NullPointerException before returning; please mirror the setter's null guard before iterating.


java.nio.file.Paths.get("/tmp/unparsed_final.log"),

P3 Badge Remove the diagnostic write from shared test execution

When a BDD scenario response contains an UnparsedObject, this shared helper now appends to /tmp/unparsed_final.log and swallows any failure. That makes normal local/CI test runs mutate global temp state and potentially race or accumulate stale output across parallel runs, while the test harness never consumes the file; please remove this leftover diagnostic or gate it behind an explicit debug flag.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ddadamhooper ddadamhooper changed the title Correctly fail to parse list-of-oneOf with an invalid item Correctly set unparsed on list-of-oneOf with an invalid item Jul 14, 2026
@ddadamhooper ddadamhooper changed the title Correctly set unparsed on list-of-oneOf with an invalid item Mark list-of-oneOf with an invalid item as unparsed Jul 14, 2026
@ddadamhooper

Copy link
Copy Markdown
Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9c67b6d59a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .generator/src/generator/templates/modelOneOf.j2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/Fixed Fixed features results into a bug fix version bump mergequeue-status: removed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants