知识卡片
问题详情的扩展字段
application/problem+json 的 type 用来区分错误种类,扩展字段可携带该类问题特有的机器信息,如验证错误位置。给一类错误稳定的 URI 和处理说明,让客户端按类型读扩展,保留统一的基本形状。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Supporting the unhappy path: Error handling with problem+json 18.5 The problem+json format · 查看原书依据
Developers can extend the format with additional fields. They can provide more machine-readable information, and the type URI should define the semantics for interpreting these fields. The specification for the problem+json format does not go into further details.
参考来源
- 位置:《Designing APIs with Swagger and OpenAPI》第18章《Supporting the unhappy path: Error handling with problem+json》(来源项目 book-source:extracted/Designing APIs with Swagger and OpenAPI/_epub-src/OEBPS/Text/ch18.htm,阅读块 136)
- 结论依据:原文说明 type URI 用于定义扩展字段的解释。
- 原始内容:Developers can extend the format with additional fields. They can provide more machine-readable information, and the type URI should define the semantics for interpreting these fields. The specification for the problem+json format does not go into further details.