← Back to Pull requests

fix: keep nullable when single allOf type replaces a property #25828

Open
unknown opened this pull request with 315 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 26, 2026 07:22 UTC
Author

Property with allOf of one inline type plus nullable: true from #20373 is replaced in InlineModelResolver by that only item, so nullable is lost: two: {allOf: [{type: string}], nullable: true} gives two: string in typescript-axios and StrictStr in python. Same shape with $ref inside allOf doesnt lose it

Now nullable of property is copied to the item when it has none. Added test in InlineModelResolverTest. Regenerated all samples: only typescript-fetch enum builds change, their nullable-string-enum / nullable-number-enum have same shape and become | null as spec says

Fixes #20373

PR checklist

  • Read the contribution guidelines.

  • Run the following to build the project and update samples:

  •   ./mvnw clean package || exit
      ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
      ./bin/utils/export_docs_generators.sh || exit
      

    Commit all changed files.
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.
  • <!-- This is an auto-generated description by cubic. -->
    ---

    Summary by cubic


    Fixes nullable being lost when InlineModelResolver flattens a property whose allOf contains a single inline type. The property's nullable value is now copied to the replacement item when the item doesn't set its own, matching the behavior already present for $ref-based allOf items. Tests cover both inline-type and $ref allOf items, and regenerated typescript-fetch enum samples now emit | null for nullable enums, matching the spec.

    <sup>Written for commit 5b5ab087694adadf3109f6d11393ccc91d9db130. Summary will update on new commits.</sup>

    <a href="https://cubic.dev/pr/OpenAPITools/openapi-generator/pull/25828?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="View guided diff" src="https://www.cubic.dev/buttons/review-in-cubic-light.svg"></picture></a>

    <!-- End of auto-generated description by cubic. -->

    Diff: 315 lines (+236 / -79) across 3 files Reviewer: thekhegay Review duration: 6304m
    All Vouch review confidence checks passed
    Residual risk 0.22 = Change Risk (0.40) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.40 · 315 lines diff across 3 files
    0.40
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.344
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #25828"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 40.4% (MEDIUM) · Higher = larger blast radius
    40.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 21.5% · Safe to merge
    21.5%