From 10f6b28790083ccfcccda754551c1137436fbee2 Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Thu, 7 Nov 2024 12:22:40 +0900 Subject: [PATCH] add comment --- packages/backend/src/models/Page.ts | 11 +++++++++++ packages/backend/src/models/json-schema/page.ts | 7 +++++++ 2 files changed, 18 insertions(+) diff --git a/packages/backend/src/models/Page.ts b/packages/backend/src/models/Page.ts index d27d35944d..34817f2c2d 100644 --- a/packages/backend/src/models/Page.ts +++ b/packages/backend/src/models/Page.ts @@ -121,6 +121,15 @@ export class MiPage { export const pageNameSchema = { type: 'string', pattern: /^[a-zA-Z0-9_-]{1,256}$/.source } as const; +//#region ページブロックのスキーマ(バリデーション用) + +/** + * 併せてpackedPageBlockSchemaも更新すること + * (そっちはAPIの戻り型の定義なので以下の定義とは若干異なる) + * + * packages/backend/src/models/json-schema/page.ts + */ + const blockBaseSchema = { type: 'object', properties: { @@ -222,3 +231,5 @@ export const pageBlockSchema = { noteBlockSchema, ], } as const; + +//#endregion diff --git a/packages/backend/src/models/json-schema/page.ts b/packages/backend/src/models/json-schema/page.ts index 0fe1ca5901..c7a36453f4 100644 --- a/packages/backend/src/models/json-schema/page.ts +++ b/packages/backend/src/models/json-schema/page.ts @@ -3,6 +3,13 @@ * SPDX-License-Identifier: AGPL-3.0-only */ +/** + * ページブロックのスキーマを変更したら、併せてpageBlockSchemaも更新すること + * (そっちは入力バリデーション用の定義なので以下の定義とは若干異なる) + * + * packages/backend/src/models/Page.ts + */ + const packedBlockBaseSchema = { type: 'object', properties: {