#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
#229 added
Vary: Accept-EncodingtoGzipMiddlewareand documented it inopenapi/openapi.yamlon the success responses and the shared error response. Nothing keeps the spec in step the wayTestSpec_Every200DeclaresCacheControldoes forCache-Control.The gap: someone adds a new endpoint, documents
Cache-Control(which the spec test enforces) but forgetsVary, 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_Every200DeclaresCacheControlthat asserts every response carryingVaryon the wire declares it in the spec. The middleware addsVaryto every response that reaches a handler (the 2xx blocks and the handler-produced errors), so the assertion covers the success responses plus the sharedErrorresponse, and excludes the 401 tier (auth short-circuits before gzip, so 401s carry no Vary).Surfaced during the #228 / #229 run. Not urgent.