知识卡片
错误兼顾人机读取
错误响应同时给清晰短说明和稳定的结构化分类。表单可以按字段位置高亮,监控可按类型聚合,文案可以独立调整。客户端按约定的机器标识分支。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Supporting the unhappy path: Error handling with problem+json 18.3 Requirements for error responses · 查看原书依据
If we want to answer these questions without applying natural language processing to the human-readable error message, we should accompany the message with a set of structured data in a consistent format. What would be an appropriate schema though?
参考来源
- 位置:《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,阅读块 90)
- 结论依据:原文说明让程序从自然语言提取字段和原因代价高,应提供结构化信息。
- 原始内容:If we want to answer these questions without applying natural language processing to the human-readable error message, we should accompany the message with a set of structured data in a consistent format. What would be an appropriate schema though?