知识卡片
兼容演进三条承诺
已发布接口的非破坏性演进遵守三条规则:不删除已有元素、不重定义含义、新增元素可选。新增必填参数应放到新动作,保留旧动作;新动作本身也不能变成旧客户端必须执行的步骤。承诺还应说明客户端如何容忍未知内容;仅发布新版文档不足以保证所有使用者及时迁移。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 用超媒体思考与设计 · 查看原书依据
Don’t redefine things. You cannot change the meaning or use of an existing element of the interface. For example, if the response message was published as a user object, you cannot change it to a user collection. If the output property count was documented as containing the number of records in the collection, you cannot change its meaning to the number of records on a single page response. Make additions optional. After the initial publication of the API, any additional inputs or outputs must be documented as optional—you cannot add new required properties for existing interfaces.