Skip to content

Conversation

@koxudaxi
Copy link
Owner

@koxudaxi koxudaxi commented Jan 6, 2026

Summary by CodeRabbit

  • New Features
    • Enhanced JSON Schema feature support tracking for constants, property names, contains keywords, and deprecated keywords.
    • Expanded OpenAPI feature support tracking for webhooks and reference sibling keywords across different schema versions.

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

@coderabbitai
Copy link

coderabbitai bot commented Jan 6, 2026

Warning

Rate limit exceeded

@koxudaxi has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 3 minutes and 13 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 f1bb5be and 421e463.

⛔ Files ignored due to path filters (1)
  • docs/llms-full.txt is excluded by none and included by none
📒 Files selected for processing (1)
  • docs/supported_formats.md
📝 Walkthrough

Walkthrough

New boolean feature flags added to JsonSchemaFeatures (const_support, property_names, contains, deprecated_keyword) and OpenAPISchemaFeatures (webhooks, ref_sibling_keywords) to track partial schema capabilities. Version-based factory methods updated to set flag states appropriately for specific schema versions.

Changes

Cohort / File(s) Summary
Feature Flags Implementation
src/datamodel_code_generator/parser/schema_version.py
Added 4 new fields to JsonSchemaFeatures (const_support, property_names, contains, deprecated_keyword) with metadata; added 2 new fields to OpenAPISchemaFeatures (webhooks, ref_sibling_keywords). Updated JsonSchemaFeatures.from_version() to set const_support and property_names to False for Draft4. Updated OpenAPISchemaFeatures.from_openapi_version() to set webhooks and ref_sibling_keywords to True for non-V30.
Feature Flags Tests
tests/parser/test_schema_version.py
Added test assertions for new JsonSchemaFeatures and OpenAPISchemaFeatures fields to verify correct initialization across different schema/API versions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

🐰 Hopping through schemas with flags so bright,
Const support, webhooks, all feature-light!
From Draft4 to OpenAPI's gleam,
New booleans dance in the dataclass dream!

Pre-merge checks and finishing touches

✅ Passed checks (3 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: adding new feature fields (const_support, property_names, contains, deprecated_keyword, webhooks, ref_sibling_keywords) with metadata to JsonSchemaFeatures and OpenAPISchemaFeatures dataclasses.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2026

📚 Docs Preview: https://pr-2946.datamodel-code-generator.pages.dev

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
tests/parser/test_schema_version.py (1)

125-138: Consider explicit new fields in Draft 6+ tests for completeness.

The Draft 4 test explicitly includes const_support=False and property_names=False, but Draft 6+ tests rely on defaults (True). While functionally correct (inline_snapshot matches the full dataclass), explicitly including these fields in the other tests would improve test clarity and make the version differences more apparent.

Similarly, test_openapi_features_v30 (lines 212-227) doesn't explicitly include webhooks=False and ref_sibling_keywords=False.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fd5e698 and f1bb5be.

📒 Files selected for processing (2)
  • src/datamodel_code_generator/parser/schema_version.py
  • tests/parser/test_schema_version.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: Analyze (python)
  • GitHub Check: 3.10 on Windows
  • GitHub Check: 3.12 on Windows
  • GitHub Check: 3.11 on macOS
  • GitHub Check: 3.14 on Windows
  • GitHub Check: 3.10 on macOS
  • GitHub Check: 3.13 on Windows
  • GitHub Check: 3.13 on macOS
  • GitHub Check: 3.11 on Windows
  • GitHub Check: benchmarks
🔇 Additional comments (9)
tests/parser/test_schema_version.py (3)

107-122: LGTM!

The test correctly verifies that Draft 4 lacks const and propertyNames support (both introduced in Draft 6), matching the implementation.


230-247: LGTM!

The test correctly verifies that OpenAPI 3.1 has webhooks and ref_sibling_keywords support, matching the implementation.


250-267: LGTM!

The test correctly verifies that OpenAPI Auto defaults to latest features, including webhooks and ref_sibling_keywords.

src/datamodel_code_generator/parser/schema_version.py (6)

121-157: LGTM!

The new feature flags for const_support, property_names, contains, and deprecated_keyword have appropriate defaults and accurate metadata reflecting their introduction versions and implementation status.


158-239: LGTM!

The unsupported feature flags are well-documented with accurate metadata. All have default=False and status="not_supported", which is correct for features not yet implemented.


244-257: LGTM!

Draft 4 correctly sets const_support=False and property_names=False, as these features were introduced in Draft 6.


258-301: Verify: Should deprecated_keyword be set to True for Draft 2019-09+?

The deprecated_keyword field has status="partial" and introduced="2019-09". Currently, Draft 2019-09 and later versions don't explicitly set this field, relying on the default of False.

If the intent is to track feature availability (even if partially implemented), consider setting deprecated_keyword=True for Draft 2019-09+. If the intent is to track full implementation support, the current behavior is correct.


332-396: LGTM!

The new OpenAPI feature flags have appropriate defaults and accurate metadata. webhooks and ref_sibling_keywords correctly default to False and are explicitly enabled for OpenAPI 3.1+.


415-429: LGTM!

The non-V30 case correctly enables webhooks=True and ref_sibling_keywords=True, as these are OpenAPI 3.1 features.

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 6, 2026

CodSpeed Performance Report

Merging this PR will not alter performance

Comparing feature/comprehensive-schema-feature-metadata (421e463) with main (abac763)

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

Summary

✅ 11 untouched benchmarks
⏩ 98 skipped benchmarks1

Footnotes

  1. 98 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.

@codecov
Copy link

codecov bot commented Jan 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (abac763) to head (421e463).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #2946   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           94        94           
  Lines        17696     17716   +20     
  Branches      2037      2037           
=========================================
+ Hits         17696     17716   +20     
Flag Coverage Δ
unittests 100.00% <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.

@koxudaxi koxudaxi merged commit 4decf36 into main Jan 7, 2026
39 checks passed
@koxudaxi koxudaxi deleted the feature/comprehensive-schema-feature-metadata branch January 7, 2026 02:57
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.

2 participants