Skip to content

Move --strict-nullable from OpenAPI-only to Field customization#2727

Merged
koxudaxi merged 2 commits intomainfrom
fix-strict-nullable-docs
Dec 21, 2025
Merged

Move --strict-nullable from OpenAPI-only to Field customization#2727
koxudaxi merged 2 commits intomainfrom
fix-strict-nullable-docs

Conversation

@koxudaxi
Copy link
Copy Markdown
Owner

@koxudaxi koxudaxi commented Dec 21, 2025

Fixes: #1656

Summary by CodeRabbit

  • Changes
    • The --strict-nullable CLI option is now available through field customization settings, allowing users to treat default fields as non-nullable fields across more configuration scenarios.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Dec 21, 2025

Warning

Rate limit exceeded

@koxudaxi has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 6 minutes and 29 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between fe89fcb and 3115e25.

📒 Files selected for processing (4)
  • docs/cli-reference/model-customization.md (2 hunks)
  • docs/cli-reference/quick-reference.md (2 hunks)
  • src/datamodel_code_generator/arguments.py (1 hunks)
  • tests/main/openapi/test_main_openapi.py (1 hunks)

Walkthrough

The --strict-nullable CLI option is moved from the OpenAPI-specific options group to the general field customization group. This makes the option visible and available for all input types, not just OpenAPI, and removes the misleading "(Only OpenAPI)" qualifier from its help text.

Changes

Cohort / File(s) Change Summary
CLI option reorganization
src/datamodel_code_generator/arguments.py
Relocated --strict-nullable from openapi_options argument group to field_options argument group; updated help text to remove OpenAPI-specific qualifier, making the flag discoverable for JSON Schema and other input types

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5–10 minutes

  • Single file change with straightforward argument relocation
  • No logic modifications or side effects expected
  • Verify that the option placement doesn't conflict with other field options and that existing tests still pass

Possibly related PRs

Poem

🐰 A hop, a skip, and a flag takes flight,
From OpenAPI's nest to options bright,
Now all may see what JSON Schema knew—
--strict-nullable works for you too!
No more hiding in that section small,
This rabbit's work helps discover all! ✨

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: moving the --strict-nullable option from OpenAPI-only to Field customization group.
Linked Issues check ✅ Passed The PR addresses the core objective of issue #1656 by moving --strict-nullable from OpenAPI-only to Field customization, making it discoverable for JSON Schema users.
Out of Scope Changes check ✅ Passed All changes are directly related to the objective of moving --strict-nullable from OpenAPI-only to Field customization; no out-of-scope modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.35%. Comparing base (8a10962) to head (3115e25).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2727   +/-   ##
=======================================
  Coverage   99.35%   99.35%           
=======================================
  Files          83       83           
  Lines       11868    11868           
  Branches     1433     1433           
=======================================
  Hits        11792    11792           
  Misses         45       45           
  Partials       31       31           
Flag Coverage Δ
unittests 99.35% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Dec 21, 2025

CodSpeed Performance Report

Merging #2727 will not alter performance

Comparing fix-strict-nullable-docs (3115e25) with main (8a10962)

Summary

✅ 70 untouched
⏩ 10 skipped1

Footnotes

  1. 10 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@koxudaxi koxudaxi force-pushed the fix-strict-nullable-docs branch from fe89fcb to ed8b294 Compare December 21, 2025 11:25
🤖 Generated by GitHub Actions
@koxudaxi koxudaxi merged commit 0f92860 into main Dec 21, 2025
38 checks passed
@koxudaxi koxudaxi deleted the fix-strict-nullable-docs branch December 21, 2025 11:33
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.

CLI help incorrectly shows --strict-nullable as only applying to OpenAPI

1 participant