Skip to content

checker: response header deprecation and sunset dates are not checked #1314

Open

Description

@reuvenharrison

A response header can be marked deprecated: true, and the diff already records the change (HeaderDiff.DeprecatedDiff), but no check reads it. Operations, parameters and properties all follow the deprecation lifecycle; response headers follow none of it.

Two consequences:

  1. Deprecating a response header, or reactivating one, is not reported at all.
  2. Removing a required response header is reported as required-response-header-removed (error) whether or not it was deprecated, and whatever its x-sunset date. A team that deprecated the header and waited out the sunset still gets an error.

Expected

Response headers get the same stages as properties:

Stage Proposed id
deprecated, with and without a sunset date response-header-deprecated, response-header-deprecated-with-sunset
deprecated without a sunset date while a deprecation policy is set response-header-deprecated-sunset-missing
sunset date sooner than the policy allows response-header-sunset-date-too-small
sunset date that can't be parsed response-header-deprecated-sunset-invalid
reactivated response-header-reactivated
required header removed while deprecated, no sunset date required-response-header-removed-with-deprecation (info)
required header removed before its sunset date required-response-header-removed-before-sunset (error)
required header removed after its sunset date not reported

optional-response-header-removed is already info, so it needs no deprecation variant, the same as response-optional-property-removed.

Example

# base
responses:
  '200':
    headers:
      X-Rate-Limit:
        required: true
        deprecated: true
        x-sunset: "2020-01-01"
        schema: {type: integer}
# revision: X-Rate-Limit removed

Today: required-response-header-removed, error. Expected: nothing reported, since the sunset date has passed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions