メインコンテンツまでスキップ
バージョン: 0.13.0 (Previous)

📐 通知スキーマ

通知スキーマは、ルートパス、共通のページネーション、および一括既読のアンカー本文を検証します。

一覧

エクスポートリクエストの場所契約
updateNotificationToReadSchemaパス必須の文字列通知 ID。
findNotificationsSchemaパス、クエリ必須のアイデンティティ ID とページネーション。
updateNotificationToReadBatchSchemaパス、本文アイデンティティ ID と厳格な既読アンカー本文。
共通のパラメーター定義
const notificationIdPathParameter: OpenAPIParameter = {
in: 'path',
name: 'notificationId',
required: true,
schema: {
type: 'string',
},
};

export const identityIdPathParameter: OpenAPIParameter = {
in: 'path',
name: 'identityId',
required: true,
schema: {
type: 'string',
},
};

export const paginationQueryParametersSchema: OpenAPIParameter[] = [
{
in: 'query',
name: 'page',
required: false,
schema: {maximum: 1000, minimum: 1, type: 'integer'},
},
{
in: 'query',
name: 'limit',
required: false,
schema: {maximum: 50, minimum: 1, type: 'integer'},
},
];

詳細

updateNotificationToReadSchema

定義

ルートでの使用: updateNotificationToReadRoute機能での使用: updateNotificationToReadFeature

場所フィールド必須制約
パスnotificationId文字列はい形式またはパターンなし。
完全なソースを表示
export const updateNotificationToReadSchema = withSchema({
parameters: [{...notificationIdPathParameter}],
});

findNotificationsSchema

定義

ルートでの使用: findNotificationsRoute機能での使用: findNotificationsFeature。本文はありません。

場所フィールド必須制約
パスidentityId文字列はい形式またはパターンなし。
クエリpage整数いいえ最小値 1、最大値 1000
クエリlimit整数いいえ最小値 1、最大値 50
完全なソースを表示
export const findNotificationsSchema = withSchema({
parameters: [
{
in: 'path',
name: 'identityId',
required: true,
schema: {
type: 'string',
},
},
...paginationQueryParametersSchema,
],
});

updateNotificationToReadBatchSchema

定義

ルートでの使用: updateNotificationToReadBatchRoute機能での使用: updateNotificationToReadBatchFeature。本文は必須かつ厳格です(additionalProperties: false)。

場所フィールド必須制約
パスidentityId文字列はい共通のアイデンティティパスパラメーター。形式またはパターンなし。
本文lastReadNotificationId文字列はい必須の application/json プロパティ。追加の本文プロパティは不可。
完全なソースを表示
export const updateNotificationToReadBatchSchema = withSchema({
parameters: [
{
...identityIdPathParameter,
},
],
requestBody: {
content: {
'application/json': {
schema: {
$schema: 'http://json-schema.org/draft-07/schema#',
additionalProperties: false,
properties: {
lastReadNotificationId: {type: 'string'},
},
required: ['lastReadNotificationId'],
type: 'object',
},
},
},
required: true,
},
});