DELETE booking requests fail with 422 error - missing support for request_body in destroy method
@AaronDDM 已经在做这个了。
开始于 2026年2月23日。
评估
这个 Issue 还没有评估数据。
描述
Describe the bug
The Bookings#destroy method doesn't support passing a request_body parameter (e.g., for cancellation_reason), and the underlying ApiOperations::Delete#delete method hardcodes payload: nil. This causes 422 Unprocessable Entity errors when calling the Nylas API to delete bookings.
When HTTParty sends a DELETE request with payload: nil, it doesn't properly set the Content-Type: application/json header, causing the Nylas API to reject the request. Additionally, there's no way to pass optional body parameters like cancellation_reason which are supported by the Nylas Scheduling API.
To Reproduce
require 'nylas'
nylas = Nylas::Client.new(
api_key: ENV["NYLAS_API_KEY"],
api_uri: ENV["NYLAS_API_URI"]
)
# This fails with 422 Unprocessable Entity error
nylas.scheduler.bookings.destroy(
booking_id: "booking-123",
query_params: { configuration_id: "config-456" }
)
# Error: Nylas::NylasApiError - Unprocessable Entity
# Stack trace shows the error originates from:
# /lib/nylas/handler/http_client.rb:333:in `handle_failed_response'
# /lib/nylas/handler/api_operations.rb:149:in `delete'
# /lib/nylas/resources/bookings.rb:69:in `destroy'
Additionally, there's no way to pass a cancellation_reason:
# This SHOULD work but isn't currently supported
nylas.scheduler.bookings.destroy(
booking_id: "booking-123",
query_params: { configuration_id: "config-456" },
request_body: { cancellation_reason: "Meeting no longer needed" }
)
# Error: unknown keyword: :request_body
Expected behavior
- DELETE requests should work without throwing 422 errors when no request body is needed
- The Bookings#destroy method should accept an optional request_body parameter to support API features like cancellation_reason
- The ApiOperations::Delete#delete method should default to payload: {} instead of payload: nil to ensure proper Content-Type headers are sent
SDK Version:
nylas gem: 6.7.0
Additional context
This issue appears to have been introduced in version 6.5.0 when the SDK switched from rest-client to httparty.
- 主要语言
- Ruby
- 星标
- 103
- 派生
- 131
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
rubyjs/mini_racer#449 ·
-
[BUG]: Export Donations button state not updating可能已有人在做 @yashiyadav 今天认领。 未关闭🐞 Bug
难度 2/5 1-3 小时 新手友好度 64/100
rubyforgood/human-essentials#5744 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
paradigmxyz/centaur#2034 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
Lint/NoReturnInMemoization flags `return` in local variable `||=` and `&&=` assignments可能已有人在做 @RaphaelFakhri 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
Shopify/ruby-style-guide#815 ·