summaryrefslogtreecommitdiff
path: root/packages/backend/src/server/api/endpoints/users/show.ts
diff options
context:
space:
mode:
authortamaina <tamaina@hotmail.co.jp>2023-02-26 11:28:05 +0900
committerGitHub <noreply@github.com>2023-02-26 11:28:05 +0900
commit18dbcfa0b09715a234a4eca0288e17d5cbf7622c (patch)
treeefd9e83b3e11919926fd80790ad272d1d9e7bda6 /packages/backend/src/server/api/endpoints/users/show.ts
parentSimplify search.vue (remove dead code) (#10088) (diff)
downloadmisskey-18dbcfa0b09715a234a4eca0288e17d5cbf7622c.tar.gz
misskey-18dbcfa0b09715a234a4eca0288e17d5cbf7622c.tar.bz2
misskey-18dbcfa0b09715a234a4eca0288e17d5cbf7622c.zip
test(server): add validation test of api:notes/create (#10090)
* fix(server): notes/createのバリデーションが効いていない Fix #10079 Co-Authored-By: mei23 <m@m544.net> * anyOf内にバリデーションを書いても最初の一つしかチェックされない * :v: * wip * wip * :v: * RequiredProp * Revert "RequiredProp" This reverts commit 74693900119a590263106fa3adefd008d69ce80c. * add api:notes/create * fix lint * text * :v: * improve readability --------- Co-authored-by: mei23 <m@m544.net> Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
Diffstat (limited to 'packages/backend/src/server/api/endpoints/users/show.ts')
-rw-r--r--packages/backend/src/server/api/endpoints/users/show.ts40
1 files changed, 15 insertions, 25 deletions
diff --git a/packages/backend/src/server/api/endpoints/users/show.ts b/packages/backend/src/server/api/endpoints/users/show.ts
index 70258ef009..29f24b045a 100644
--- a/packages/backend/src/server/api/endpoints/users/show.ts
+++ b/packages/backend/src/server/api/endpoints/users/show.ts
@@ -54,32 +54,22 @@ export const meta = {
export const paramDef = {
type: 'object',
- anyOf: [
- {
- properties: {
- userId: { type: 'string', format: 'misskey:id' },
- },
- required: ['userId'],
- },
- {
- properties: {
- userIds: { type: 'array', uniqueItems: true, items: {
- type: 'string', format: 'misskey:id',
- } },
- },
- required: ['userIds'],
- },
- {
- properties: {
- username: { type: 'string' },
- host: {
- type: 'string',
- nullable: true,
- description: 'The local host is represented with `null`.',
- },
- },
- required: ['username'],
+ properties: {
+ userId: { type: 'string', format: 'misskey:id' },
+ userIds: { type: 'array', uniqueItems: true, items: {
+ type: 'string', format: 'misskey:id',
+ } },
+ username: { type: 'string' },
+ host: {
+ type: 'string',
+ nullable: true,
+ description: 'The local host is represented with `null`.',
},
+ },
+ anyOf: [
+ { required: ['userId'] },
+ { required: ['userIds'] },
+ { required: ['username'] },
],
} as const;