From 7f1651df713871c8d616d1cf18d7e6ffeaa37607 Mon Sep 17 00:00:00 2001 From: Daniel Dietzler <36593685+danieldietzler@users.noreply.github.com> Date: Tue, 23 Apr 2024 00:13:44 +0200 Subject: [PATCH] chore(server): enable swagger to take class validator rules into account (#9022) * enable swagger to take class validator rules into account * chore: open api --- mobile/openapi/lib/model/create_user_dto.dart | Bin 5615 -> 5638 bytes .../openapi/lib/model/download_info_dto.dart | Bin 4939 -> 4962 bytes .../openapi/lib/model/job_settings_dto.dart | Bin 2807 -> 2830 bytes .../lib/model/metadata_search_dto.dart | Bin 33413 -> 33485 bytes mobile/openapi/lib/model/on_this_day_dto.dart | Bin 2681 -> 2704 bytes .../openapi/lib/model/recognition_config.dart | Bin 4539 -> 4654 bytes .../openapi/lib/model/smart_search_dto.dart | Bin 24290 -> 24362 bytes .../lib/model/system_config_f_fmpeg_dto.dart | Bin 8046 -> 8256 bytes .../lib/model/system_config_image_dto.dart | Bin 4688 -> 4782 bytes .../lib/model/system_config_o_auth_dto.dart | Bin 6884 -> 6907 bytes .../lib/model/system_config_trash_dto.dart | Bin 3062 -> 3085 bytes .../lib/model/system_config_user_dto.dart | Bin 2897 -> 2920 bytes mobile/openapi/lib/model/update_user_dto.dart | Bin 8824 -> 8847 bytes open-api/immich-openapi-specs.json | 45 ++++++++++++++++++ server/nest-cli.json | 2 +- 15 files changed, 46 insertions(+), 1 deletion(-) diff --git a/mobile/openapi/lib/model/create_user_dto.dart b/mobile/openapi/lib/model/create_user_dto.dart index 2dada4f672889656b92435400adcaea3c48560fc..c29a8538e4feeaaea766b3a693783845fcf741bc 100644 GIT binary patch delta 33 ocmaE_-KMkQ3A2d4zP^HQW?p7)X|6(9VoqtQm4e~shs=CJ0MG#ofB*mh delta 12 TcmZqEd9S_U3G?RP%-li%CVK@k diff --git a/mobile/openapi/lib/model/download_info_dto.dart b/mobile/openapi/lib/model/download_info_dto.dart index 0bfdbe9f32cf236ffb33c76788c157a1265d78b0..7de463b7cb05c4fca872c407aaad80d213a6aac1 100644 GIT binary patch delta 29 kcmX@D_DF3*AhV!?Z)RR*ZfUMUSz=CUs+EG_VsB;v0HNFo)Bpeg delta 17 ZcmaE)c3N#iAoJ!gEK!V`53wxZ0{})?2P*&o diff --git a/mobile/openapi/lib/model/job_settings_dto.dart b/mobile/openapi/lib/model/job_settings_dto.dart index 777611cc8cc782ad0f6e6e003bdc7792b4444ffe..c7c10c267b3cd05bdc54426f0cfb7627094f1a6b 100644 GIT binary patch delta 33 ocmew^+9$SQ5u=E{zP^HQW?p7)X|6(9VoqtQm4e~s`HT^q0K~it9RL6T delta 12 TcmeAZ`!2d+5##2ajG>$WBNhbD diff --git a/mobile/openapi/lib/model/metadata_search_dto.dart b/mobile/openapi/lib/model/metadata_search_dto.dart index 3f770ed092f1d41be8065d7db888f14e178c7463..ee5e7aa4f6ae65b1fc0a444c75a359bc19d4756f 100644 GIT binary patch delta 91 zcmZo|Wjfo+v>``RP{B7dFEh6^SD`F1r!>_{!EkdUX9DBqV_Krj+8A``x^KF4B#?5!NM42J1TK#}v0JRkhYybcN diff --git a/mobile/openapi/lib/model/on_this_day_dto.dart b/mobile/openapi/lib/model/on_this_day_dto.dart index ef1471dfb79422d721c817b9f19920aa46679627..81b13e391bfa202a3026309b0f4fd761e8cf1a00 100644 GIT binary patch delta 33 pcmewx7xXtFJnR4^9xhCub1 cc_j+DnR#xB$*INGTrdNOGS_f(DpMFg09CjvA^-pY delta 31 mcmZ3dvRiqB1JmR@CUL&Zyb^`n%sjWm Rpy)6#FaT@Xtg5)z7666a9j5>Q delta 28 hcmZ3rkMYr7#tkNNn=J*S7$+~4w*@mc=PK^C1puU83X1>$ diff --git a/mobile/openapi/lib/model/system_config_f_fmpeg_dto.dart b/mobile/openapi/lib/model/system_config_f_fmpeg_dto.dart index b1c0f278a98c7d2a24a54493f68ffb28693a0fcf..758bc37fa460ea7a6b7f007d188f164023ed91d9 100644 GIT binary patch delta 240 zcmaE7cfesoG>fjjzP^HQW?p7)X|6(9VoqtQm4dDzmx2OVJh1{<+|X=t1dFOa799rI zHJE}7%FHWKNG?jV=7Om~waj308;hn0HZv!$VX@Q3CIK@D)pcf*pR+VzHE44RE0+`i DTMJ0| delta 38 ucmX@$@Xl^SG|S{}7A4Niyb^`vqBLu+$$wZhC)==EPhQGeyV;VBT?zmflMM_2 diff --git a/mobile/openapi/lib/model/system_config_image_dto.dart b/mobile/openapi/lib/model/system_config_image_dto.dart index 7072e11270ab3e9d09f06d7ca531a805723bd77f..46e598d6be06a9344d84d35ab923cf389344f817 100644 GIT binary patch delta 126 zcmcbhvQBlwF{TK8eSHPr%)HFp(p-hI#GKMpD+NO?1%=GK5`}`I)UwRf^5D#>RBJAv c7!IXi;lv6Q6ATO{UuQBF!KPy~JF_Q002XQ|F#rGn delta 34 pcmZ3ddO>BwF($#xyb^_iqSUg?)bilWs#I&P$#Trbn=_c*_yOr!3-|y4 diff --git a/mobile/openapi/lib/model/system_config_o_auth_dto.dart b/mobile/openapi/lib/model/system_config_o_auth_dto.dart index 1e7fe7f0001f6deaa6c27bad676359fe56c28a12..1b43f3eb726b8bad41fbac5f1c4afbf6a823e01b 100644 GIT binary patch delta 33 ocmaE2`rCBFS!NM^eSHPr%)HFp(p-hI#GKMpD+Pnirlhbv0szfY3%dXS delta 20 ccmaDMc2R7@Mn>k$ypqW=OtPC_Fg9=k09djI$p8QV diff --git a/mobile/openapi/lib/model/update_user_dto.dart b/mobile/openapi/lib/model/update_user_dto.dart index 8fc85b48680ea76ef84a6629062c5a1a357962f0..7a8f097975278628bbe1467c6cdb60060a2f41a7 100644 GIT binary patch delta 33 ocmez2((k%KhFe5mUthsDGcPl@G*_W4F{d=uO2KfmBzL?x0Kn!7ng9R* delta 12 TcmeBo{o%4fhI_LycZ@gyA&dk} diff --git a/open-api/immich-openapi-specs.json b/open-api/immich-openapi-specs.json index b5bf2c9f4d..c2483d690c 100644 --- a/open-api/immich-openapi-specs.json +++ b/open-api/immich-openapi-specs.json @@ -1447,6 +1447,8 @@ "required": true, "in": "query", "schema": { + "minimum": 1, + "maximum": 31, "type": "integer" } }, @@ -1455,6 +1457,8 @@ "required": true, "in": "query", "schema": { + "minimum": 1, + "maximum": 12, "type": "integer" } } @@ -1499,6 +1503,7 @@ "required": false, "in": "query", "schema": { + "minimum": 1, "type": "number" } } @@ -2086,6 +2091,7 @@ "required": false, "in": "query", "schema": { + "minimum": 1, "type": "number" } }, @@ -2123,6 +2129,8 @@ "required": false, "in": "query", "schema": { + "minimum": 1, + "maximum": 1000, "type": "number" } }, @@ -4456,6 +4464,7 @@ "required": false, "in": "query", "schema": { + "minimum": 1, "type": "number" } }, @@ -4488,6 +4497,8 @@ "required": false, "in": "query", "schema": { + "minimum": 1, + "maximum": 1000, "type": "number" } }, @@ -5622,6 +5633,7 @@ "required": true, "in": "query", "schema": { + "minimum": 1, "type": "integer" } }, @@ -8054,6 +8066,7 @@ "properties": { "newPassword": { "example": "password", + "minLength": 8, "type": "string" }, "password": { @@ -8286,6 +8299,7 @@ }, "quotaSizeInBytes": { "format": "int64", + "minimum": 1, "nullable": true, "type": "integer" }, @@ -8391,6 +8405,7 @@ "type": "string" }, "archiveSize": { + "minimum": 1, "type": "integer" }, "assetIds": { @@ -8731,6 +8746,7 @@ "JobSettingsDto": { "properties": { "concurrency": { + "minimum": 1, "type": "integer" } }, @@ -9203,6 +9219,7 @@ "type": "string" }, "page": { + "minimum": 1, "type": "number" }, "personIds": { @@ -9220,6 +9237,8 @@ "type": "string" }, "size": { + "maximum": 1000, + "minimum": 1, "type": "number" }, "state": { @@ -9321,6 +9340,7 @@ "OnThisDayDto": { "properties": { "year": { + "minimum": 1, "type": "number" } }, @@ -9676,13 +9696,18 @@ }, "maxDistance": { "format": "float", + "maximum": 2, + "minimum": 0, "type": "number" }, "minFaces": { + "minimum": 1, "type": "integer" }, "minScore": { "format": "float", + "maximum": 1, + "minimum": 0, "type": "number" }, "modelName": { @@ -10401,6 +10426,7 @@ "type": "string" }, "page": { + "minimum": 1, "type": "number" }, "personIds": { @@ -10414,6 +10440,8 @@ "type": "string" }, "size": { + "maximum": 1000, + "minimum": 1, "type": "number" }, "state": { @@ -10551,21 +10579,27 @@ "type": "array" }, "bframes": { + "maximum": 16, + "minimum": -1, "type": "integer" }, "cqMode": { "$ref": "#/components/schemas/CQMode" }, "crf": { + "maximum": 51, + "minimum": 0, "type": "integer" }, "gopSize": { + "minimum": 0, "type": "integer" }, "maxBitrate": { "type": "string" }, "npl": { + "minimum": 0, "type": "integer" }, "preferredHwDevice": { @@ -10575,6 +10609,8 @@ "type": "string" }, "refs": { + "maximum": 6, + "minimum": 0, "type": "integer" }, "targetAudioCodec": { @@ -10590,6 +10626,7 @@ "type": "boolean" }, "threads": { + "minimum": 0, "type": "integer" }, "tonemap": { @@ -10638,15 +10675,19 @@ "$ref": "#/components/schemas/ImageFormat" }, "previewSize": { + "minimum": 1, "type": "integer" }, "quality": { + "maximum": 100, + "minimum": 1, "type": "integer" }, "thumbnailFormat": { "$ref": "#/components/schemas/ImageFormat" }, "thumbnailSize": { + "minimum": 1, "type": "integer" } }, @@ -10835,6 +10876,7 @@ "type": "string" }, "defaultStorageQuota": { + "minimum": 0, "type": "number" }, "enabled": { @@ -11013,6 +11055,7 @@ "SystemConfigTrashDto": { "properties": { "days": { + "minimum": 0, "type": "integer" }, "enabled": { @@ -11028,6 +11071,7 @@ "SystemConfigUserDto": { "properties": { "deleteDelay": { + "minimum": 1, "type": "integer" } }, @@ -11254,6 +11298,7 @@ }, "quotaSizeInBytes": { "format": "int64", + "minimum": 1, "nullable": true, "type": "integer" }, diff --git a/server/nest-cli.json b/server/nest-cli.json index b295cd0f83..1eaf1888d5 100644 --- a/server/nest-cli.json +++ b/server/nest-cli.json @@ -9,7 +9,7 @@ { "name": "@nestjs/swagger", "options": { - "classValidatorShim": false, + "classValidatorShim": true, "introspectComments": true } }