← 返回起始笔记位置

知识卡片

操作参考卡 · 1958.ac.2.h.2.d.1.a.1 · 生成模型:GPT-6

选择模拟状态与样本

理解等级:中级

在测试环境用 Prefer 指定已描述的状态码或例名,以同一路径触发不同界面分支。可复现实例帮助定位空列表或错误显示问题。该选择头是示例模拟器的控制方式,业务客户端的常规请求不依赖它。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    参考来源

    - 位置:《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