Skip to content

[rust] Name a oneOf member without a title or type after its base type - #25017

Open
HardMax71 wants to merge 2 commits into
OpenAPITools:masterfrom
HardMax71:rust-oneof-member-without-type
Open

HardMax71 wants to merge 2 commits into
OpenAPITools:masterfrom
HardMax71:rust-oneof-member-without-type

Conversation

@HardMax71

@HardMax71 HardMax71 commented Sep 26, 2026 •

Copy link
Copy Markdown

Fixes #25016.

When an inline oneOf member has no title and no type (for example allOf with a single $ref plus required), the variant name now falls back to the member's base type instead of passing null to toModelName. The type lookup also goes through ModelUtils.getType, which reads types for 3.1 schemas. The repro from #25016 now generates WorkflowPathCondition(Box<models::WorkflowPathCondition>) and the crate compiles, and GitHub's current REST description, which failed on actions-policy-repo-conditions, generates without errors.

The new testOneOfMemberWithoutTitleOrType fails on master with the NullPointerException.

PR checklist


Summary by cubic

Fixes a Rust codegen NullPointerException when an inline oneOf member has neither a title nor a type, such as an allOf with a single $ref plus required.

Bug Fixes

  • Variant names now fall back to the member's base type instead of passing null to toModelName; type lookup uses ModelUtils.getType, which reads types for 3.1 schemas.
  • The repro from [BUG][Rust] NullPointerException naming a oneOf member that has no title or type #25016 now generates WorkflowPathCondition(Box<models::WorkflowPathCondition>) and compiles, and GitHub's current REST description generates without errors.
  • Adds testOneOfMemberWithoutTitleOrType, which fails on master with the NullPointerException, and cleans up the files it generates.

Written for commit 8a6d013. Summary will update on new commits.

Review in cubic

Copilot AI lite review requested due to automatic review settings September 26, 2026 23:45

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 3 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG][Rust] NullPointerException naming a oneOf member that has no title or type

2 participants