知识卡片
媒体类型协商版本
保留旧的 application/json,同时以明确的供应商媒体类型描述新 Schema。客户端用 Content-Type 声明发出的正文,用 Accept 表示期望响应。服务器按双方支持的格式选择并声明实际媒体类型,默认协商行为也须写清。
这张卡片看不懂?
这张卡片已通过人工审查,不再接受失败反馈。
已有反馈 · 0 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- Versioning an API and handling breaking changes 20.3 Releasing a breaking change · 查看原书依据
We introduced media types in chapter 5 and mostly used the JSON media type (application/json), but we’ve also seen more specific media types (like application/ problem+json). We can also define our own custom media types that follow the format application/vnd.some.cool.example+json—anything between the
参考来源
- 位置:《Designing APIs with Swagger and OpenAPI》第20章《Versioning an API and handling breaking changes》(来源项目 book-source:extracted/Designing APIs with Swagger and OpenAPI/_epub-src/OEBPS/Text/ch20.htm,阅读块 99)
- 结论依据:原文以 vendor 媒体类型与 Accept、Content-Type 描述不同表示。
- 原始内容:We introduced media types in chapter 5 and mostly used the JSON media type (application/json), but we’ve also seen more specific media types (like application/ problem+json). We can also define our own custom media types that follow the format application/vnd.some.cool.example+json—anything between the