知识卡片
选择模拟状态与样本
在测试环境用 Prefer 指定已描述的状态码或例名,以同一路径触发不同界面分支。可复现实例帮助定位空列表或错误显示问题。该选择头是示例模拟器的控制方式,业务客户端的常规请求不依赖它。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Implementing frontend code and reacting to changes 12.4 Identifying a missing API operation · 查看原书依据
Now it’s time to test the API mock. Using Prism with a single example described works perfectly, as you’ve seen. But we have described multiple examples and want to be able to choose which of those examples to use. To help us
参考来源
- 位置:《Designing APIs with Swagger and OpenAPI》第12章《Implementing frontend code and reacting to changes》(来源项目 book-source:extracted/Designing APIs with Swagger and OpenAPI/_epub-src/OEBPS/Text/ch12.htm,阅读块 138)
- 结论依据:书中 Prism 可通过 Prefer 选择状态与例名。
- 原始内容:Now it’s time to test the API mock. Using Prism with a single example described works perfectly, as you’ve seen. But we have described multiple examples and want to be able to choose which of those examples to use. To help us