知识卡片
可比较的API契约
把同一操作的请求前提和响应形状写入结构化契约,就可以从版本差异中找出可能让既有调用失败的改动。新增必填输入会缩小有效请求集合,删除输出字段会让依赖它的客户端失去信息。检查依赖描述与实现保持一致。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Introducing APIs and OpenAPI 1.2 Describing things · 查看原书依据
Bridget decides she needs a way of describing APIs so that she can compare an old API with a new one to see if the new one has any breaking changes. She writes a program that compares the description of an older
参考来源
- 位置:《Designing APIs with Swagger and OpenAPI》第01章《Introducing APIs and OpenAPI》(来源项目 book-source:extracted/Designing APIs with Swagger and OpenAPI/_epub-src/OEBPS/Text/ch01.htm,阅读块 25)
- 结论依据:Bridget 比较旧版与新版描述以提前辨认破坏性改动。
- 原始内容:Bridget decides she needs a way of describing APIs so that she can compare an old API with a new one to see if the new one has any breaking changes. She writes a program that compares the description of an older