Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

弃用 DELETE 请求 带有 body 的删除图片的请求 #81

Open
1 task
Jiang-Xuan opened this issue Dec 23, 2019 · 1 comment
Open
1 task

弃用 DELETE 请求 带有 body 的删除图片的请求 #81

Jiang-Xuan opened this issue Dec 23, 2019 · 1 comment
Assignees
Labels
BackEnd 后端开发中
Milestone

Comments

@Jiang-Xuan
Copy link
Owner

Jiang-Xuan commented Dec 23, 2019

  • 更新 api 文档

根据 OAI/OpenAPI-Specification#1937, https://tools.ietf.org/html/rfc7231#section-4.3.1

GET, DELETE, HEAD 方法的 body 没有明确的语义, 不应该使用, 在 OAS3.0.2 中已经禁止了 DELETE 方法拥有 requestBody 属性

The request body applicable for this operation. The requestBody is only supported in HTTP methods where the HTTP 1.1 specification [RFC7231] has explicitly defined semantics for request bodies. In other cases where the HTTP spec is vague, requestBody SHALL be ignored by consumers.

但是在后续的 OAS3.x 会允许 body, 但是不鼓励使用 OAI/OpenAPI-Specification#1937

目前该系统移除图片的 DELTE 接口只支持的是 body 传移除的 key, 这不应该支持, 但是已经支持, 后续 @deprecated 该方式传参

替代方案

使用 url param 传参, 或者是通过 url 片段传参
来自 #53 (comment)

@Jiang-Xuan
Copy link
Owner Author

在 v1 版本中弃用该接口格式, 在 v2 版本中移除该请求接口格式

@Jiang-Xuan Jiang-Xuan self-assigned this Dec 23, 2019
@Jiang-Xuan Jiang-Xuan added the BackEnd 后端开发中 label Dec 23, 2019
@Jiang-Xuan Jiang-Xuan added this to the Backlog milestone Dec 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BackEnd 后端开发中
Projects
None yet
Development

No branches or pull requests

1 participant