From ca29fdc7954d9af751a38d137a252886b04f69e8 Mon Sep 17 00:00:00 2001 From: tamaina Date: Mon, 15 May 2023 09:19:36 +0000 Subject: [PATCH] fix --- packages/misskey-js/src/endpoints.ts | 40 ++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/packages/misskey-js/src/endpoints.ts b/packages/misskey-js/src/endpoints.ts index 630e9d1a6..6de8146a1 100644 --- a/packages/misskey-js/src/endpoints.ts +++ b/packages/misskey-js/src/endpoints.ts @@ -283,7 +283,12 @@ export const endpoints = { properties: { title: { type: 'string', minLength: 1 }, text: { type: 'string', minLength: 1 }, - imageUrl: { type: 'string', nullable: true, minLength: 1 }, + imageUrl: { + oneOf: [ + { type: 'string', minLength: 1 }, + { type: 'null' }, + ], + }, }, required: ['title', 'text', 'imageUrl'], }, @@ -362,7 +367,12 @@ export const endpoints = { id: { type: 'string', format: 'misskey:id' }, title: { type: 'string', minLength: 1 }, text: { type: 'string', minLength: 1 }, - imageUrl: { type: 'string', nullable: true, minLength: 1 }, + imageUrl: { + oneOf: [ + { type: 'string', minLength: 1 }, + { type: 'null' }, + ], + }, }, required: ['id', 'title', 'text', 'imageUrl'], }, @@ -404,14 +414,28 @@ export const endpoints = { limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 }, sinceId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' }, - userId: { type: 'string', format: 'misskey:id', nullable: true }, - type: { type: 'string', nullable: true, pattern: /^[a-zA-Z0-9\/\-*]+$/.toString().slice(1, -1) }, + userId: { + oneOf: [ + { type: 'string', format: 'misskey:id' }, + { type: 'null' }, + ], + }, + type: { + oneOf: [ + { type: 'string', pattern: /^[a-zA-Z0-9\/\-*]+$/.toString().slice(1, -1) }, + { type: 'null' }, + ], + }, origin: { type: 'string', enum: ['combined', 'local', 'remote'], default: 'local' }, hostname: { - type: 'string', - nullable: true, - default: null, - description: 'The local host is represented with `null`.', + oneOf: [ + { + type: 'string', + default: null, + description: 'The local host is represented with `null`.', + }, + { type: 'null' }, + ], }, }, required: [],