Flex Gateway新着情報
Governance新着情報
Monitoring API Managerこのガイドでは、DataGraph の API 拡張機能を定義します。
この拡張機能により、オブジェクト種別に主キーがあり、リファレンスまたは拡張機能として使用できることがマークされます。
この拡張機能は、ObjectType
に適用されます。
項目 | 型 | 説明 |
---|---|---|
|
Map (マップ) |
オブジェクト種別をエンティティとしてマークします。 |
|
String (文字列) |
空にできない配列。各項目は、エンティティのキーである項目を参照する必要があります。 |
components: schemas: Customer: x-entity: key: [id] properties: name: type: string email: type: string id: type: string ...
copy
types: Customer: (dg.entity): key: [id] properties: name: type: string email: type: string id: type: string ...
copy
この拡張機能により、1 つの種別から別の種別への DataGraph リンクが生成されます。リンクは、同じ API 仕様で定義されない種別にできます。
この拡張機能は、ObjectType
に適用されます。
項目 | 型 | 説明 |
---|---|---|
|
オブジェクトの配列 |
すべてのリファレンスのリスト。 |
|
String (文字列) |
参照される種別の名前。API に含まれる場合も含まれない場合もあります。 |
|
String (文字列) |
この種別について作成される新しい項目の名前。 |
|
Map (マップ) |
マップのキーはこの種別の項目を表しており、値は参照される種別のキーを表しています。 |
components: Schemas: Order: x-entity-reference: - name: Customer fieldName: customer keyMapping: customerId: id - name: Store fieldName: store keyMapping: storeId: id properties: orderItems: ... customerId: type: string storeId: type: string Customer: x-entity: key: [id] properties: name: type: string email: type: string id: type: string Store: x-entity: key: [id] properties: name: type: string id: type: string ...
copy
types: Order: (dg.entity-reference): - name: Customer fieldName: customer keyMapping: customerId: id - name: Store fieldName: store keyMapping: storeId: id properties: orderItems: ... customerId: type: string storeId: type: string Customer: (dg.entity): key: [id] properties: name: type: string email: type: string id: type: string ... Store: (dg.entity): key: [id] properties: name: type: string id: type: string
copy
この拡張機能では、エンドポイントが ID によってエンティティのインスタンスを返すとマークします。 DataGraph では、これはデフォルトのクエリ方法です。
この拡張機能は、GET 操作に適用されます。
対象は操作で暗黙的であるため、指定されません。
項目 | 型 | 説明 |
---|---|---|
|
Map (マップ) |
エンドポイントがエンティティインスタンスを返すとマークします。 |
|
Map (マップ) |
マップのキーはこの操作のパラメーターを表しており、値は対象種別のキーを表しています。 |
Schemas: Customer: x-entity: key: [id] properties: name: type: string email: type: string 1: type: string ... paths: "/customers/{customerId}": get: x-entityProvider: keyMapping: customerId: id parameters: - in: query name: summaryView default: true schema: type: boolean ... responses: '200': content: application/json: schema: $ref: "#/components/schemas/Customer"
copy
types: Customer: (dg.entity): key: [id] properties: name: type: string email: type: string id: type: string … /customer/{customerId}: uriParameters: customerId: string get: (dg.entityProvider): keyMapping: customerId: id responses: 200: application/json: body: Customer
copy
この拡張機能を使用して、POST メソッドを GET メソッドとして扱います。この拡張機能では、POST メソッドを変異ではなくクエリ操作に変換します。
この拡張機能は、操作に適用されます。
対象は操作で暗黙的であるため、指定されません。
項目 | 型 | 説明 |
---|---|---|
|
Map (マップ) |
上書きされる操作をマークします。 |
|
String (文字列) |
元の操作を上書きするために使用される HTTP メソッド。 |
paths: "/customers": post: x-http-method-override: method: get responses: '200': content: application/json: schema: type: array items: $ref: "#/components/schemas/Customer"
copy
/customers: post: (dg.http-method-override): method: get responses: 200: body: application/json: type: Customer[]
copy
メインのアノテーション datagraph
を異なるドメインで同じ名前にすることはできません。そのため、操作、種別、オブジェクトプロパティのアノテーションではポストフィックスを使用します。
操作: -method
種別: -type
オブジェクトプロパティ: -field
この拡張機能を使用して、要素を非表示とマークします。非表示の要素は統合スキーマに表示されず、DataGraph ではどのクエリでも非表示の要素が返されません。
この拡張機能は、以下に適用されます。
操作
任意の種別
オブジェクトプロパティ
対象は操作で暗黙的であるため、指定されません。
項目 | 型 | 説明 |
---|---|---|
|
Map (マップ) |
DataGraph 固有のアノテーションのコンテナ。 |
|
Boolean (ブール) |
|
components: Schemas: Customer: x-datagraph: hide: true properties: name: type: string email: type: string x-datagraph: hide: true id: type: string ... paths: "/customers/{customerId}": get: x-datagraph: hide: true parameters: - in: query name: summaryView default: true schema: type: boolean ... responses: '200': content: application/json: schema: $ref: "#/components/schemas/Customer"
copy
types: Customer: (dg.datagraph): hide: true properties: name: type: string email: type: string (dg.datagraph): hide: true id: type: string … /customer/{customerId}: uriParameters: customerId: string get: (dg.datagraph): hide: true responses: 200: application/json: body: Customer
copy
この拡張機能を使用して、統合スキーマの要素に特定の名前を定義するなど、DataGraph で要素の目的の名前を設定します。この拡張機能を使用して、基礎となる API を変更することなく、さまざまな API の種別を統合できます。
この拡張機能は、以下に適用されます。
操作
任意の種別
オブジェクトプロパティ
対象は操作で暗黙的であるため、指定されません。
項目 | 型 | 説明 |
---|---|---|
|
Map (マップ) |
DataGraph 固有のアノテーションのコンテナ。 |
|
String (文字列) |
DataGraph の要素の目的の名前。可能であれば、有効な名前にパターンを使用してください。 |
components: Schemas: Customer: x-datagraph: name: SalesCustomer properties: name: type: string e-mail: type: string x-datagraph: name: email id: type: string ... paths: "/customers/{customerId}": get: x-datagraph: name: getCustomer parameters: - in: query name: summaryView default: true schema: type: boolean ... responses: '200': content: application/json: schema: $ref: "#/components/schemas/Customer"
copy
types: Customer: (dg.datagraph): name: SalesCustomer properties: name: type: string e-mail: type: string (dg.datagraph): name: email id: type: string … /customer/{customerId}: uriParameters: customerId: string get: (dg.datagraph): name: getCustomer responses: 200: application/json: body: Customer
copy