Widgets: better oneOf schema support#38288
Open
ddadamhooper wants to merge 6 commits into
Open
Conversation
This comment has been minimized.
This comment has been minimized.
Author
|
/review |
Contributor
There was a problem hiding this comment.
🤖 Automated review by Claude. AI-generated; verify before acting.
Nice cleanup — replacing generic Option N labels with schema-derived <type=…> names should make the rendered API tables noticeably easier to navigate. A few small nits on the new helpers below; nothing blocking.
Reviewed 08c566844f3264a1df15ebbe41e57e449ef66531 — workflow run
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
StefonSimmons
approved these changes
Jul 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do? What is the motivation?
Supports generating widget documentation once we introduce nested
oneOf. See https://github.com/DataDog/datadog-api-spec/pull/5974 -- this failed buildAlso: I found it hard to "see" my change in the widget list, so I scratched an itch and changed the "Option 1", "Option 2", etc. to:
<type=foo>and<type=bar>. This affects a bunch of documents.How we find a discriminant (e.g.,
typeordata_source):oneOfbranch, the discriminant must be a string enumHow we render an item (e.g.,
<type=timeseries>):Merge readiness
For Datadog employees:
<name>/<description>convention and include the forward slash (/). If you've already created your PR with an incorrect branch name, please rename your branch and open a fresh PR./reviewto run an automated check that catches common issues before a Documentation team member reviews your PR.AI assistance
I flipped back and forth with Opus 4.8. Most of the code is mine.
Additional notes