Skip to content

feat: add OpenAPI 3.1 breaking change checker rules#796

Open
reuvenharrison wants to merge 1 commit intofeat/openapi-3.1-supportfrom
feat/openapi-3.1-checker
Open

feat: add OpenAPI 3.1 breaking change checker rules#796
reuvenharrison wants to merge 1 commit intofeat/openapi-3.1-supportfrom
feat/openapi-3.1-checker

Conversation

@reuvenharrison
Copy link
Collaborator

Summary

  • Add 12 const change rules (request/response body/property added/removed/changed) for detecting breaking changes when const values are modified
  • Add 2 webhook rules (added/removed) using ComponentChange for webhook-level diff reporting
  • Add nullable type array detection for OpenAPI 3.1: suppress false positives in type checkers when only "null" is added/removed from type arrays, and detect nullable changes via type: ["string", "null"] in existing nullable checkers
  • Add localized messages for all new rules in en, es, pt-br, and ru
  • Add 12 missing list-of-types description entries to es, pt-br, and ru

New files

  • checker/check_request_property_const_changed.go — request body/property const rules
  • checker/check_response_property_const_changed.go — response body/property const rules
  • checker/check_webhook_updated.go — webhook added/removed rules
  • checker/nullable_type_utils.go — helpers for null type array detection
  • Test files and test data YAML for all new rules

Modified files

  • checker/check_request_property_type_changed.go — suppress null-only type changes
  • checker/check_response_property_type_changed.go — suppress null-only type changes
  • checker/check_request_parameters_type_changed.go — suppress null-only type changes
  • checker/check_request_property_became_not_nuallable.go — detect nullable via type array
  • checker/check_response_property_became_nuallable.go — detect nullable via type array
  • checker/rules.go — register 16 new rules
  • Localization files (en, es, pt-br, ru)

Test plan

  • All existing tests pass (go test ./... -count=1)
  • New const change tests (request body/property added/removed/changed, response property)
  • New webhook added/removed tests
  • New 3.1 nullable type array tests (request property, response property, became not nullable)
  • Type checker suppression tests (request + response type checkers don't fire for null-only changes)
  • go vet and go fmt clean

🤖 Generated with Claude Code

Add checker rules for const field changes, webhook add/remove, and
nullable type arrays (OpenAPI 3.1 style). Includes localized messages
for en, es, pt-br, and ru.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov-commenter
Copy link

codecov-commenter commented Feb 11, 2026

Codecov Report

❌ Patch coverage is 82.59109% with 43 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.21%. Comparing base (699dcef) to head (9dc6c7a).
⚠️ Report is 4 commits behind head on feat/openapi-3.1-support.

Files with missing lines Patch % Lines
...ker/check_request_property_became_not_nuallable.go 54.16% 20 Missing and 2 partials ⚠️
...hecker/check_response_property_became_nuallable.go 62.85% 11 Missing and 2 partials ⚠️
checker/check_request_parameters_type_changed.go 0.00% 2 Missing and 2 partials ⚠️
checker/check_request_property_type_changed.go 50.00% 1 Missing and 1 partial ⚠️
checker/check_response_property_type_changed.go 50.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@                     Coverage Diff                      @@
##           feat/openapi-3.1-support     #796      +/-   ##
============================================================
- Coverage                     89.34%   89.21%   -0.14%     
============================================================
  Files                           240      244       +4     
  Lines                         12276    12505     +229     
============================================================
+ Hits                          10968    11156     +188     
- Misses                          860      894      +34     
- Partials                        448      455       +7     
Flag Coverage Δ
unittests 89.21% <82.59%> (-0.14%) ⬇️

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.

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