機械翻訳について

サポートされているカスタムjq関数

Rapid Adapter Builderプラットフォームは、次のカスタムjq関数をサポートしています:

connectivity::to_entries

このカスタムto_entriesファンクションでは、カスタム・キーおよび値ラベルを使用できます。

この表は、この関数の入力および出力引数について説明しています。

入力 出力
  • 配列に変換されたJSONオブジェクト。
  • 配列内のキーごとにKeyName。
  • 配列内の各値のKeyName。

エントリのJSON配列。

入力JSON:

{ "potato": true, "broccoli": false }

アダプタ定義ドキュメントの式:

{ "arguments": { "body": "${ {vegetableFeedback : connectivity::to_entries(.input; .configuration.key; "like") } }" } }

.configuration.keyveggieNameに解決されるJSON形式の出力:

{ ... "body" : { "vegetableFeedback" : [ { "veggieName" : "potato", "like" : true }, { "veggieName" : "broccoli", "like" : false } ] } }

connectivity::from_entries

このカスタムfrom_entriesファンクションでは、カスタム・キーおよび値ラベルを使用できます。

この表は、この関数の入力および出力引数について説明しています。

入力 出力
  • オブジェクトに変換されたJSONオブジェクト。
  • 配列内のキーごとにKeyName。
  • 配列内の各値のKeyName。

JSONオブジェクト

入力JSON:

{ "vegetables": [ { "veggieName": "potato", "like": true }, { "veggieName": "broccoli", "like": false } ] }

アダプタ定義ドキュメントの式:

{ "arguments": { "body": "${ {vegetableFeedback : connectivity::from_entries(.input.vegetables; .configuration.key; "like") } }" } }

.configuration.keyveggieNameに解決されるJSON形式の出力:

{ ... "body" : { "vegetableFeedback" : { "potato" : true, "broccoli" : false } } }

connectivity::json_data_to_json_schema

このファンクションは、JSONデータをJSONスキーマに変換します。

この表は、入力および出力引数について説明しています。

入力 出力

任意のJSONオブジェクトまたは配列。

JSONオブジェクト型としてのJSONスキーマ。

入力JSON

{ "vegetables": [ { "veggieName": "potato", "like": true }, { "veggieName": "broccoli", "like": false } ] }

アダプタ定義ドキュメントの式:

{ "arguments": { "body": "${ {vegetableFeedback : connectivity::json_data_to_json_schema(.input.vegetables) } }" } }

JSONの出力

{ "body": { "vegetableFeedback": { "type": "array", "items": { "type": "object", "properties": { "veggieName": { "type": "string" }, "like": { "type": "boolean" } } } } } }

connectivity::swagger_schema

このファンクションは、swaggerドキュメントを解析し、リクエストおよびレスポンスのjsonスキーマを抽出します。

この表は、入力および出力引数について説明しています。

入力 出力
  • JSON形式のSwaggerドキュメント。
  • SwaggerドキュメントのパスID。
  • 2番目のパラメータのパスの下にあるHTTPメソッド。
  • 列挙値の形式でのレスポンスまたはリクエスト。

JSONスキーマ

入力JSON

{ "swagger": "2.0", "info": { "description": "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", "version": "1.0.6", "title": "Swagger Petstore", ... }, "host": "petstore.swagger.io", "basePath": "/v2", ... }

アダプタ定義ドキュメントの式:

{ "name": "parseSchema", "type": "expression", "operation": "connectivity::swagger_schema(.swagger; .configuration.path; .configuration.method; "request")" }

JSONの出力

{ "type": "object", "properties": { "body": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64" }, ... } } } }