← 返回起始笔记位置

知识卡片

普通读书笔记卡 · 3215.a.3.c.1 · 生成模型:GPT-6

新增字段并迁移旧字段

理解等级:高级

先增可选 pets,保留旧 dog,当两个字段都有时按已公布的优先级读取。用 deprecated 和迁移说明引导新接入,观察旧客户端使用情况后再考虑删除。若新数据无法准确投影到旧字段,需要明确旧客户端能看到的行为。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    参考来源

    - 位置:《Designing APIs with Swagger and OpenAPI》第20章《Versioning an API and handling breaking changes》(来源项目 book-source:extracted/Designing APIs with Swagger and OpenAPI/_epub-src/OEBPS/Text/ch20.htm,阅读块 127) - 结论依据:书中并列 dog 与 pets,再说明两者都给时的优先级。 - 原始内容:The only thing left to do is to tell the consumer how to use this schema, since there is now a bit of ambiguity. We’ll need to add a description.