メインコンテンツまでスキップ
バージョン: 0.14.0 (以前)

📐 Profile スキーマ

Profile スキーマは、保存するプロフィール断片と、Profile 機能およびルートが使用する HTTP リクエスト契約を定義します。

一覧​

エクスポートリクエスト位置契約
ProfileFollow該当なし{ followProfileId: string } を保存する。
OrganizationFollow該当なし{ followOrganizationId: string } を保存する。
ProductLike該当なし{ likeProductId: string } を保存する。
profileSchema該当なしidentityId、name、任意の avatar/null を持つ保存プロフィール。
createProfileSchema本文必須の JSON identityId、name、任意の avatar/null。
updateProfileSchemaパス、本文必須のパス ID。JSON は name と avatar/null を含められる。
getProfileSchemaパス必須の profileId。
deleteProfileSchemaパス必須の profileId。
findProfilesSchemaクエリ任意の identityId、name、共有ページネーション。
createProfileFollowSchemaパス必須のプロフィール ID とフォロー先プロフィール ID。
deleteProfileFollowSchemaパス必須のプロフィール ID とフォロー先プロフィール ID。
getProfileFollowersSchemaパス必須のプロフィール ID。
createOrganizationFollowSchemaパス必須のプロフィール ID と組織 ID。
deleteOrganizationFollowSchemaパス必須のプロフィール ID と組織 ID。
createProductLikeSchemaパス必須のプロフィール ID と商品 ID。
deleteProductLikeSchemaパス必須のプロフィール ID と商品 ID。

詳細​

ProfileFollow​

定義

保存するリレーションの形式は followProfileId: string です。プロフィールブロックのフォロー操作で使用します。

完全なソースを表示
export type ProfileFollow = {
followProfileId: string;
};

OrganizationFollow​

定義

保存するリレーションの形式は followOrganizationId: string です。プロフィールブロックの組織フォロー操作で使用します。

完全なソースを表示
export type OrganizationFollow = {
followOrganizationId: string;
};

ProductLike​

定義

保存するリレーションの形式は likeProductId: string です。プロフィールブロックの商品「いいね」操作で使用します。

完全なソースを表示
export type ProductLike = {
likeProductId: string;
};

profileSchema​

定義

再利用可能な保存プロフィールの形式です。additionalProperties: false により、定義されていないプロパティは許可されません。

場所フィールド型必須制約
該当なしavatarAvatar または nullいいえ共有の avatarSchema と null の oneOf
該当なしidentityIdstringいいえ作成スキーマでは必須
該当なしnamestringいいえ作成スキーマでは必須

使用するルート: createProfileRoute. 使用する機能: createProfileFeature.

完全なソースを表示
export const profileSchema: SchemaDefinition = {
$schema: 'http://json-schema.org/draft-07/schema#',
additionalProperties: false,
properties: {
avatar: {
oneOf: [avatarSchema, { type: 'null' }],
},
identityId: { type: 'string' },
name: { type: 'string' },
},
type: 'object',
};

createProfileSchema​

定義

application/json のリクエスト本文が必要です。profileSchema を展開し、identityId と name を必須にします。追加フィールドは拒否されます。

場所フィールド型必須制約
本文identityIdstringはい—
本文namestringはい—
本文avatarAvatar または nullいいえ共有 avatar スキーマ

使用するルート: createProfileRoute. 使用する機能: createProfileFeature.

完全なソースを表示
export const createProfileSchema = withSchema({
requestBody: {
content: {
'application/json': {
schema: {
...profileSchema,
required: ['identityId', 'name'],
},
},
},
required: true,
},
});

updateProfileSchema​

定義

パスのプロフィール ID と application/json のリクエスト本文が必要です。本文は追加フィールドを許可せず、ソースの required フィールド一覧が空であるため空にできます。ただし、レガシーハンドラーは空の本文を別途拒否します。

場所フィールド型必須制約
パスprofileIdstringはい—
本文namestringいいえ—
本文avatarAvatar または nullいいえ共有 avatar スキーマ

使用するルート: updateProfileRoute. 使用する機能: editProfileFeature.

完全なソースを表示
export const updateProfileSchema = withSchema({
parameters: [{ ...profileIdPathParameter }],
requestBody: {
content: {
'application/json': {
schema: {
additionalProperties: false,
properties: {
avatar: {
oneOf: [avatarSchema, { type: 'null' }],
},
name: { type: 'string' },
},
required: [],
type: 'object',
},
},
},
required: true,
},
});

getProfileSchema​

定義
場所フィールド型必須制約
パスprofileIdstringはい—

使用するルート: getProfileRoute. 使用する機能: getProfileFeature.

完全なソースを表示
export const getProfileSchema = withSchema({
parameters: [{ ...profileIdPathParameter }],
});

deleteProfileSchema​

定義
場所フィールド型必須制約
パスprofileIdstringはい—

使用するルート: deleteProfileRoute. 使用する機能: deleteProfileFeature.

完全なソースを表示
export const deleteProfileSchema = withSchema({
parameters: [{ ...profileIdPathParameter }],
});

findProfilesSchema​

定義
場所フィールド型必須制約
クエリidentityIdstringいいえ—
クエリnamestringいいえ—
クエリページネーションフィールド共有いいえpaginationQueryParametersSchema

使用するルート: findProfilesRoute. 使用する機能: findProfilesFeature.

完全なソースを表示
export const findProfilesSchema = withSchema({
parameters: [
{
in: 'query',
name: 'identityId',
required: false,
schema: {
type: 'string',
},
},
{
in: 'query',
name: 'name',
required: false,
schema: {
type: 'string',
},
},
...paginationQueryParametersSchema,
],
});

createProfileFollowSchema​

定義
場所フィールド型必須制約
パスprofileIdstringはい—
パスfollowProfileIdstringはい—

使用するルート: createProfileFollowRoute. 使用する機能: createProfileFollowFeature.

完全なソースを表示
export const createProfileFollowSchema = withSchema({
parameters: [profileIdPathParameter, followProfileIdPathParameter],
});

deleteProfileFollowSchema​

定義
場所フィールド型必須制約
パスprofileIdstringはい—
パスfollowProfileIdstringはい—

使用するルート: deleteProfileFollowRoute. 使用する機能: deleteProfileFollowFeature.

完全なソースを表示
export const deleteProfileFollowSchema = withSchema({
parameters: [profileIdPathParameter, followProfileIdPathParameter],
});

getProfileFollowersSchema​

定義
場所フィールド型必須制約
パスprofileIdstringはい—

使用するルート: getProfileFollowersRoute. 使用する機能: getProfileFollowersFeature.

完全なソースを表示
export const getProfileFollowersSchema = withSchema({
parameters: [profileIdPathParameter],
});

createOrganizationFollowSchema​

定義
場所フィールド型必須制約
パスprofileIdstringはい—
パスfollowOrganizationIdstringはい—

使用するルート: createOrganizationFollowRoute. 使用する機能: createOrganizationFollowFeature.

完全なソースを表示
export const createOrganizationFollowSchema = withSchema({
parameters: [profileIdPathParameter, followOrganizationIdPathParameter],
});

deleteOrganizationFollowSchema​

定義
場所フィールド型必須制約
パスprofileIdstringはい—
パスfollowOrganizationIdstringはい—

使用するルート: deleteOrganizationFollowRoute. 使用する機能: deleteOrganizationFollowFeature.

完全なソースを表示
export const deleteOrganizationFollowSchema = withSchema({
parameters: [profileIdPathParameter, followOrganizationIdPathParameter],
});

createProductLikeSchema​

定義
場所フィールド型必須制約
パスprofileIdstringはい—
パスlikeProductIdstringはい—

使用するルート: createProductLikeRoute. 使用する機能: createProductLikeFeature.

完全なソースを表示
export const createProductLikeSchema = withSchema({
parameters: [profileIdPathParameter, likeProductIdPathParameter],
});

deleteProductLikeSchema​

定義
場所フィールド型必須制約
パスprofileIdstringはい—
パスlikeProductIdstringはい—

使用するルート: deleteProductLikeRoute. 使用する機能: deleteProductLikeFeature.

完全なソースを表示
export const deleteProductLikeSchema = withSchema({
parameters: [profileIdPathParameter, likeProductIdPathParameter],
});