feat: add B015 lint rule for x-sunset-date validation - #1282
Merged
Conversation
Ensure specs don't set info.x-deprecated: true without a valid info.x-sunset-date. Resolves the follow-up item from x-sunset-date-linting.md: a BOAT linting rule (provider-side, at publish time) that fails when x-deprecated is true but x-sunset-date is missing, empty, or malformed (not YYYY-MM-DD). Also flags the inverse case: x-sunset-date present but x-deprecated not set, indicating a stale orphaned date. Closes the loop so future deprecations default to providing an explicit sunset date rather than silently omitting it and relying on a 7-month heuristic. Rule B015 is MUST severity (build-breaking under failOnWarning), matching the precedent of EndpointAccessControlDefinedRule (B013). Co-Authored-By: Claude <noreply@anthropic.com>
|
afsinka-backbase
approved these changes
Sep 3, 2026
| @Rule( | ||
| ruleSet = BoatRuleSet::class, | ||
| id = "B015", | ||
| severity = Severity.MUST, |
There was a problem hiding this comment.
if this will break builds for the services which already have a deprecated specs, do we need to add an explanation in README.md?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Adds a new BOAT lint rule (B015, MUST severity) that validates
info.x-deprecatedandinfo.x-sunset-dateconsistency in OpenAPI specs at provider-side publish time. This resolves follow-up item #1 from the x-sunset-date-linting plan.Rule behavior
x-deprecated: truewithoutx-sunset-date→ violationx-deprecated: truewith malformedx-sunset-date(not ISO-8601 YYYY-MM-DD) → violationx-sunset-datepresent butx-deprecatednot true → violation (orphaned date)Test plan
🤖 Generated with Claude Code