x-amazon-apigateway-integrations オブジェクト - Amazon API Gateway

x-amazon-apigateway-integrations オブジェクト

統合のコレクションを定義します。OpenAPI 定義のコンポーネントセクションで統合を定義し、統合を複数のルートに再利用できます。HTTP API に対してのみサポートされます。

プロパティ名 タイプ 説明
統合 x-amazon-apigateway-integration オブジェクト 統合オブジェクトのコレクション。

x-amazon-apigateway-integrations の例

次の例では、2 つの統合を定義する HTTP API を作成し、$ref": "#/components/x-amazon-apigateway-integrations/integration-name を使用して統合を参照します。

{ "openapi": "3.0.1", "info": { "title": "Integrations", "description": "An API that reuses integrations", "version": "1.0" }, "servers": [ { "url": "https://example.com/{basePath}", "description": "The production API server", "variables": { "basePath": { "default": "example/path" } } }], "paths": { "/": { "get": { "x-amazon-apigateway-integration": { "$ref": "#/components/x-amazon-apigateway-integrations/integration1" } } }, "/pets": { "get": { "x-amazon-apigateway-integration": { "$ref": "#/components/x-amazon-apigateway-integrations/integration1" } } }, "/checkout": { "get": { "x-amazon-apigateway-integration": { "$ref": "#/components/x-amazon-apigateway-integrations/integration2" } } } }, "components": { "x-amazon-apigateway-integrations": { "integration1": { "type": "aws_proxy", "httpMethod": "POST", "uri": "arn:aws:apigateway:us-east-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-2:123456789012:function:my-function/invocations", "passthroughBehavior": "when_no_templates", "payloadFormatVersion": "1.0" }, "integration2": { "type": "aws_proxy", "httpMethod": "POST", "uri": "arn:aws:apigateway:us-east-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-2:123456789012:function:example-function/invocations", "passthroughBehavior": "when_no_templates", "payloadFormatVersion" : "1.0" } } } }