Three endpoints answer 500 to malformed input instead of 400

オープン
#129 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
nodejs, openapi, typescript

調査の方向性

Start from the OpenAPI document mentioned in the issue and locate the controllers for /api/v1/leave/calendar, /api/v1/notifications/devices and /api/v1/files/upload in the NestJS app, then check how the global validation pipe and each handler's DTO treat a missing query string, empty body and wrong Content-Type. Reproduce each call first to confirm the 500, then make the handlers reject with VALIDATION_FAILED naming the missing from/to dates or the absent file part. Done means all three return 400 (or 415 for the upload) with a useful message and route-level tests cover the malformed cases.

索引モデルが issue の本文から書いたものです。

説明

bug

Found in the Pilot A gate (QA, main 147829f). Synthetic data only. No security impact: the production error body is the generic INTERNAL_ERROR ("An unexpected error occurred") with a request id, no stack.

Each call is made as a signed-in employee (any role gives the same answer).

Call Actual Expected
GET /api/v1/leave/calendar with no from and to 500 INTERNAL_ERROR 400 VALIDATION_FAILED naming the missing dates (the same call with ?from=2026-11-01&to=2026-12-31 works)
DELETE /api/v1/notifications/devices with no body 500 INTERNAL_ERROR 400 VALIDATION_FAILED
POST /api/v1/files/upload with Content-Type: application/json and body {} (not multipart) 500 INTERNAL_ERROR 400 or 415 ("send one part named file")

Found by sending an empty body or no query string to all 249 routes of the OpenAPI document with each role; these three were the only 5xx answers.

A caller who forgets a parameter should be told which one; the 500 also shows up in error monitoring as a fault in Cwork.

主要言語
TypeScript
スター
0
フォーク
0
平均マージ
45分
マージ済み PR(30日)
37

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

SuruchBoss/Cwork のほかの issue

SuruchBoss/Cwork の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。