Skip to content

Enforce in the spec that Vary: Accept-Encoding is declared wherever it ships #230

Description

@SyniRon

#229 added Vary: Accept-Encoding to GzipMiddleware and documented it in openapi/openapi.yaml on the success responses and the shared error response. Nothing keeps the spec in step the way TestSpec_Every200DeclaresCacheControl does for Cache-Control.

The gap: someone adds a new endpoint, documents Cache-Control (which the spec test enforces) but forgets Vary, and the spec drifts from the wire again. That is the same class of problem #228 fixed.

Proposed: add a spec-level test mirroring TestSpec_Every200DeclaresCacheControl that asserts every response carrying Vary on the wire declares it in the spec. The middleware adds Vary to every response that reaches a handler (the 2xx blocks and the handler-produced errors), so the assertion covers the success responses plus the shared Error response, and excludes the 401 tier (auth short-circuits before gzip, so 401s carry no Vary).

Surfaced during the #228 / #229 run. Not urgent.

This was generated by AI

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions