知识卡片
API版本范围的粒度
接口版本的范围可以覆盖整套 API、单个资源或单个端点。全局版本让各操作一起演进,适合认证模型等横切变化。资源版本让使用同一资源表示的操作共同支持新旧形态,减少无关操作改动。端点版本将生命周期缩小到单次操作,发布方要额外处理跨端点组合与文档快照。
判断粒度时先列依赖。若单次变更影响多个共享模型的操作,逐端点发版会留下互操作问题。细粒度版本可配合日期快照、按操作标明版本,以及回显客户端请求和实际服务的版本。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 破坏性变更与 API 演进 4.8 API versioning scope · 查看原书依据
We’ve looked at API versioning schemes that describe how an API consumer can request a particular version of the API. Another thing to consider is the level or scope at which a provider wants to evolve an API.
参考来源
- 位置:《Automating API Delivery APIOps with OpenAPI》《第 04 章 破坏性变更与 API 演进》(4.8 API versioning scope;来源项目 book-source,extracted/Automating API Delivery APIOps with OpenAPI/_epub-src/OEBPS/Text/chapter-4.xhtml#p146)
- 结论依据:用单端点、共享资源、全局认证说明选粒度的原因。
- 原始内容:We’ve looked at API versioning schemes that describe how an API consumer can request a particular version of the API. Another thing to consider is the level or scope at which a provider wants to evolve an API.