📐 アトリビューションスキーマ
アトリビューションスキーマは、再利用可能なグループの形状と、アトリビューションルートが消費するボディ、パス、およびクエリ契約を定義します。
目次
| エクスポート | リクエスト場所 | 契約 |
|---|---|---|
attributesSchema | N/A | オプションの name および空でない items;トップレベルの追加プロパティは拒否されます。 |
createAttributesSchema | ボディ | name と items が必須。 |
updateAttributesSchema | パス、ボディ | オプションの name のみ;追加プロパティは拒否されます。 |
getAttributeSchema | パス | 文字列アトリビューショングループID。 |
deleteAttributeSchema | パス | 文字列アトリビューショングループID。 |
findAttributesSchema | クエリ | 文字列 name フィルタおよび共有ページネーションパラメータ。 |
共有ソースコンテキストを表示
const attributeIdPathParameter: OpenAPIParameter = {
in: 'path',
name: 'attributeId',
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',
},
},
];
詳細
attributesSchema
定義
再利用可能な保存/リクエスト形状。トップレベルのオブジェクトは additionalProperties: false を持つ;そのネストされた items オブジェクトはソース内でこの制限を宣言しない。
| 場所 | フィールド | 型 | 必須 | 制約 |
|---|---|---|---|---|
| N/A | name | string | いいえ | — |
| N/A | items | array | いいえ | minItems: 1 |
| アイテム | key | string | はい | — |
| アイテム | value | string | はい | — |
フィーチャーでの使用: N/A — 再利用可能なスキーマ。
ルートでの使用: N/A — createAttributesSchema によって再使用される。
合成元: createAttributesSchema。完全なソースを表示
createAttributesSchema
定義
再利用可能な形状を使用する必須JSONボディ。name と items は必須;トップレベルの追加プロパティは拒否されます。
| 場所 | フィールド | 型 | 必須 | 制約 |
|---|---|---|---|---|
| ボディ | name | string | はい | — |
| ボディ | items | array | はい | 少なくとも1つのアイテム |
| ボディアイテム | key | string | はい | — |
| ボディアイテム | value | string | はい | — |
フィーチャーでの使用: createAttributeFeature。
ルートでの使用: createAttributeRoute。完全なソースを表示
updateAttributesSchema
定義
文字列 attributeId パスパラメータとJSONボディを必要とします。スキーマは必須のボディフィールドを宣言していないため {} を許可しますが、updateAttributeGroup は空のボディを 400 で拒否します。
| 場所 | フィールド | 型 | 必須 | 制約 |
|---|---|---|---|---|
| パス | attributeId | string | はい | — |
| ボディ | name | string | いいえ | 追加のボディプロパティなし |
フィーチャーでの使用: updateAttributeFeature。
ルートでの使用: updateAttributeRoute。完全なソースを表示
getAttributeSchema
定義
文字列 attributeId パスパラメータを必要とします。
| 場所 | フィールド | 型 | 必須 | 制約 |
|---|---|---|---|---|
| パス | attributeId | string | はい | — |
フィーチャーでの使用: getAttributeFeature。
ルートでの使用: getAttributeRoute。完全なソースを表示
deleteAttributeSchema
定義
文字列 attributeId パスパラメータを必要とします。
| 場所 | フィールド | 型 | 必須 | 制約 |
|---|---|---|---|---|
| パス | attributeId | string | はい | — |
フィーチャーでの使用: deleteAttributeFeature。
ルートでの使用: deleteAttributeRoute。完全なソースを表示
findAttributesSchema
定義
オプションのクエリ契約。name はアトリビューション固有の文字列フィルタ;ページネーションフィールドは paginationQueryParametersSchema から来ます。
| 場所 | フィールド | 型 | 必須 | 制約 |
|---|---|---|---|---|
| クエリ | name | string | いいえ | — |
| クエリ | page | integer | いいえ | 最小 1、最大 1000 |
| クエリ | limit | integer | いいえ | 最小 1、最大 50 |
フィーチャーでの使用: findAttributesFeature。
ルートでの使用: findAttributesRoute。完全なソースを表示