← 返回刚才阅读的位置

知识卡片

普通读书笔记卡 · 3215.b

接口规范不覆盖行为语义

理解等级:高级

OpenAPI 可生成客户端和服务端桩,也能校验请求响应的形状,但单靠结构定义无法说明不同条件下业务应如何表现。对外接口仍需以消费者场景设计行为,并用测试锁定成功、失败和边界情况;生成代码不等于契约语义已得到验证。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • · 查看原书依据

      The challenge with OpenAPI Specifications is that alone they only convey the shape of the API. OpenAPI Specifications do not fully model the semantics (or expected behavior) of the API under different conditions.

    参考来源

    - 位置:《Mastering API Architecture》第1章《Design, Build, and Specify APIs》之《Code Generation》(源文件:_epub-src/OEBPS/ch01.xhtml) - 结论依据:原文指出 OAS 支持代码生成,但它单独只表达 API 形状,不能完整刻画不同条件下的预期行为,因而需要行为建模与测试。 - 原始内容:The challenge with OpenAPI Specifications is that alone they only convey the shape of the API. OpenAPI Specifications do not fully model the semantics (or expected behavior) of the API under different conditions.