From f2ef2228c30c0aec7c0964c1f3808b52773b9c36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B9=AF=E6=9C=AC=20=E9=96=8B?= Date: Mon, 25 Dec 2023 07:34:49 +0000 Subject: [PATCH] =?UTF-8?q?Merged=20PR=20661:=20API=E3=83=90=E3=83=AA?= =?UTF-8?q?=E3=83=87=E3=83=BC=E3=82=BF=E3=81=AE=E6=BC=8F=E3=82=8C=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 概要 [Task3402: APIバリデータの漏れを修正](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/3402) - Optinal指定が必要なパラメータにOptionalが抜けていた箇所を修正 - 以前はバリデータ自体が無かったので、IsOptionalが抜けていても偶然動いていた - 他requestにも同様の漏れがないか `?:` で検索したが、この1件のみだと思われる ## レビューポイント - 他に同様の記載はなさそうか - `?:` による省略可能表記以外の記法で省略パラメータは定義されていない認識だが、合っているか ## 動作確認状況 - npm run testは通過 --- dictation_server/src/features/users/types/types.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dictation_server/src/features/users/types/types.ts b/dictation_server/src/features/users/types/types.ts index 77ac6c8..4478c13 100644 --- a/dictation_server/src/features/users/types/types.ts +++ b/dictation_server/src/features/users/types/types.ts @@ -1,5 +1,5 @@ import { ApiProperty } from '@nestjs/swagger'; -import { IsBoolean, IsEmail, IsIn, IsInt, MaxLength } from 'class-validator'; +import { IsBoolean, IsEmail, IsIn, IsInt, IsOptional, MaxLength } from 'class-validator'; import { TASK_LIST_SORTABLE_ATTRIBUTES, USER_LICENSE_STATUS, @@ -291,6 +291,7 @@ export class UpdateAcceptedVersionRequest { acceptedPrivacyNoticeVersion: string; @ApiProperty({ description: '更新バージョン(DPA)', required: false }) @MaxLength(255) + @IsOptional() acceptedDPAVersion?: string; }