更新 API meta 版本号

将 shared-contracts 与前端共享 API_VERSION 更新为 2026-06-16

同步 healthz 响应头断言与 API envelope 测试夹具

补充 api-server 文档中的 API_VERSION 来源说明
This commit is contained in:
2026-06-16 16:37:40 +08:00
parent 9ab87956f8
commit 6984af782c
9 changed files with 44 additions and 44 deletions

View File

@@ -122,7 +122,7 @@
当前基础响应头约定:
1. 所有响应都会回写 `x-request-id`
2. 所有响应都会回写固定的 `x-api-version`当前值与 body `meta.apiVersion` 保持一致。
2. 所有响应都会回写固定的 `x-api-version`,值来自 `shared_contracts::api::API_VERSION`,当前为 `2026-06-16`,并与 body `meta.apiVersion` 保持一致。
3. 所有响应都会回写 `x-route-version`,当前阶段默认与 `x-api-version` 保持一致,后续再按路由粒度细分。
4. 所有响应都会回写 `x-response-time-ms`,值来源于 `RequestContext` 内记录的请求开始时间。

View File

@@ -486,14 +486,14 @@ mod tests {
.headers()
.get("x-api-version")
.and_then(|value| value.to_str().ok()),
Some("2026-04-08")
Some("2026-06-16")
);
assert_eq!(
response
.headers()
.get("x-route-version")
.and_then(|value| value.to_str().ok()),
Some("2026-04-08")
Some("2026-06-16")
);
assert!(response.headers().contains_key("x-response-time-ms"));