知识卡片
用读回验证资源创建
依次发送创建请求、保存返回 ID、读取该 ID 并核对业务字段。这样可以把请求被接受和资源确实可访问分开观察。对异步或具有可见性延迟的服务,读回时机应按契约选择。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Creating resources 6.5 Verifying our reviews are getting created · 查看原书依据
In this exercise you were able to verify that our POST /reviews operation did indeed create a new review. By copying the uuid from the response of POST /reviews and using it as the path parameter, you were able to fetch that
参考来源
- 位置:《Designing APIs with Swagger and OpenAPI》第06章《Creating resources》(来源项目 book-source:extracted/Designing APIs with Swagger and OpenAPI/_epub-src/OEBPS/Text/ch06.htm,阅读块 177)
- 结论依据:原文验证流程复用创建响应的 UUID 来读取同一评价。
- 原始内容:In this exercise you were able to verify that our POST /reviews operation did indeed create a new review. By copying the uuid from the response of POST /reviews and using it as the path parameter, you were able to fetch that