← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 2275.as.6.f.3.c.9.b.1.b.1.a.2 · 生成模型:未记录

版本标识表达什么

理解等级:中级

SemVer 以主、次、补丁表达兼容性意义,客户端 URL 常只带主版本,规格文件仍可记完整版本。CalVer 用日期或月份表达发布时点,便于按日历计划。alpha、beta、stable 等标签表达承诺,可独立使用或作为日期后缀。

选择标识时要让调用方容易判断稳定性、预测支持期,并确认路由、文档与客户端工具能识别。高迁移成本的行业、对新功能的需求以及消费方的实际话语权都会影响发布方选择。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 破坏性变更与 API 演进 4.9 API versioning identifiers · 查看原书依据

      The Calendar Versioning (CalVer) convention (https://calver.org), mentioned earlier, is based on a project’s release calendar. Software projects use different CalVer formats, but for REST APIs, a commonly used pattern is to make the API version identifier the date the API was released. The Stripe API uses CalVer in the format YYYY-MM-DD (e.g., 2022-11-15), while Shopify’s Admin API uses a CalVer identifier in the YYYY-MM format. People are calendar oriented and may find this easier to remember.

    参考来源

    - 位置:《Automating API Delivery APIOps with OpenAPI》《第 04 章 破坏性变更与 API 演进》(4.9 API versioning identifiers;来源项目 book-source,extracted/Automating API Delivery APIOps with OpenAPI/_epub-src/OEBPS/Text/chapter-4.xhtml#p188) - 结论依据:介绍日历版本如何编码发布时间,并联系到固定版本。 - 原始内容:The Calendar Versioning (CalVer) convention (https://calver.org), mentioned earlier, is based on a project’s release calendar. Software projects use different CalVer formats, but for REST APIs, a commonly used pattern is to make the API version identifier the date the API was released. The Stripe API uses CalVer in the format YYYY-MM-DD (e.g., 2022-11-15), while Shopify’s Admin API uses a CalVer identifier in the YYYY-MM format. People are calendar oriented and may find this easier to remember.