API Gateway의 기본 요청 확인 설정 - Amazon API Gateway

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

API Gateway의 기본 요청 확인 설정

이 섹션에서는 콘솔과 OpenAPI 정의를 사용하여 API Gateway에 대한 요청 검증을 설정하는 방법을 보여줍니다. AWS CLI

API Gateway 콘솔을 사용하여 요청 확인 설정

API Gateway 콘솔을 사용하여 API 요청에 대한 세 가지 검사기 중 하나를 선택하여 요청을 확인할 수 있습니다.

  • 본문을 확인합니다.

  • 쿼리 문자열 파라미터 및 헤더를 확인합니다.

  • 본문, 쿼리 문자열 파라미터 및 헤더를 확인합니다.

API 메서드에 검증기 중 하나를 적용하면 API Gateway 콘솔이 API 맵에 검증기를 추가합니다. RequestValidators

이 자습서를 따라하려면 AWS CloudFormation 템플릿을 사용하여 불완전한 API Gateway API를 생성해 보겠습니다. 이 API에는 GETPOST 메서드가 포함된 /validator 리소스가 있습니다. 두 메서드 모두 http://petstore-demo-endpoint.execute-api.com/petstore/pets HTTP 엔드포인트와 통합됩니다. 두 가지 유형의 요청 확인을 구성합니다.

  • GET 메서드에서 URL 쿼리 문자열 파라미터에 대한 요청 확인을 구성합니다.

  • POST 메서드에서 요청 본문에 대한 요청 확인을 구성합니다.

이렇게 하면 특정 API 호출만 API로 전달될 수 있습니다.

의 앱 생성 템플릿을 다운로드하고 압축을 풉니다. AWS CloudFormation이 템플릿을 사용하여 불완전한 API를 만들 수 있습니다. API Gateway 콘솔에서 나머지 단계를 완료하게 됩니다.

스택을 AWS CloudFormation 만들려면
  1. https://console.aws.amazon.com/cloudformation 에서 AWS CloudFormation 콘솔을 엽니다.

  2. 스택 생성을 선택한 다음 새 리소스 사용(표준)을 선택합니다.

  3. 템플릿 지정에서 템플릿 파일 업로드를 선택합니다.

  4. 다운로드한 템플릿을 선택합니다.

  5. 다음을 선택합니다.

  6. 스택 이름request-validation-tutorial-console을(를) 입력하고 다음을 선택합니다.

  7. 스택 옵션 구성에서 다음을 선택합니다.

  8. [Capacabilities] 의 경우 계정에서 IAM 리소스를 생성할 AWS CloudFormation 수 있다는 점을 확인하십시오.

  9. 스택 생성을 선택합니다.

AWS CloudFormation 템플릿에 지정된 리소스를 프로비저닝합니다. 리소스 프로비저닝을 완료하는 데 몇 분 정도 걸릴 수 있습니다. AWS CloudFormation 스택 상태가 CREATE_COMPLETE이면 다음 단계로 넘어갈 준비가 된 것입니다.

새로 생성한 API를 선택하는 방법
  1. 새로 생성한 request-validation-tutorial-console 스택을 선택합니다.

  2. 리소스를 선택합니다.

  3. 물리적 ID에서 API를 선택합니다. 이 링크는 API Gateway 콘솔로 연결됩니다.

GET 및 POST 메서드를 수정하기 전에 모델을 만들어야 합니다.

모델을 생성하는 방법
  1. 수신 요청의 본문에서 요청 확인을 사용하려면 모델이 필요합니다. 모델을 생성하려면 기본 탐색 창에서 모델을 선택합니다.

  2. Create model(모델 생성)을 선택합니다.

  3. 이름PetStoreModel를 입력합니다.

  4. 콘텐츠 유형에 application/json을 입력합니다. 일치하는 콘텐츠 유형이 없는 경우 요청 확인이 수행되지 않습니다. 콘텐츠 유형에 관계없이 동일한 모델을 사용하려면 $default를 입력합니다.

  5. 설명에 모델 설명으로 My PetStore Model을 입력합니다.

  6. 모델 스키마의 경우 다음 모델을 코드 편집기에 붙여 넣고 생성을 선택합니다.

    { "type" : "object", "required" : [ "name", "price", "type" ], "properties" : { "id" : { "type" : "integer" }, "type" : { "type" : "string", "enum" : [ "dog", "cat", "fish" ] }, "name" : { "type" : "string" }, "price" : { "type" : "number", "minimum" : 25.0, "maximum" : 500.0 } } }

모델에 대한 자세한 내용은 데이터 모델 이해 섹션을 참조하세요.

GET 메서드에 대한 요청 검사를 구성하려면
  1. 기본 탐색 창에서 리소스를 선택하고 GET 메서드를 선택합니다.

  2. 메서드 요청 탭의 메서드 요청 설정에서 편집을 선택합니다.

  3. 요청 검사기에서 쿼리 문자열 파라미터 및 헤더 검사를 선택합니다.

  4. URL 쿼리 문자열 파라미터에서 다음을 수행합니다.

    1. 쿼리 문자열 추가(Add query string)를 선택합니다.

    2. 이름petType를 입력합니다.

    3. 필수를 끕니다.

    4. 캐싱을 꺼진 상태로 둡니다.

  5. 저장을 선택합니다.

  6. 통합 요청 탭의 통합 요청 설정에서 편집을 선택합니다.

  7. URL 쿼리 문자열 파라미터에서 다음을 수행합니다.

    1. 쿼리 문자열 추가(Add query string)를 선택합니다.

    2. 이름petType를 입력합니다.

    3. 다음에서 매핑됨에 method.request.querystring.petType을 입력합니다. 이렇게 하면 petType이 반려동물의 유형에 매핑됩니다.

      데이터 매핑에 대한 자세한 내용은 데이터 매핑 자습서를 참조하세요.

    4. 캐싱을 꺼진 상태로 둡니다.

  8. 저장을 선택합니다.

GET 메서드에 대한 요청 검사를 테스트하려면
  1. 테스트 탭을 선택합니다. 탭을 표시하려면 오른쪽 화살표 버튼을 선택해야 할 수도 있습니다.

  2. 쿼리 문자열에 petType=dog를 입력하고 테스트를 선택합니다.

  3. 메서드 테스트에서 200 OK와 dog 목록이 반환됩니다.

    이 출력 데이터를 변환하는 방법에 대한 자세한 내용은 데이터 매핑 자습서를 참조하세요.

  4. petType=dog를 제거하고 테스트를 선택합니다.

  5. 메서드 테스트에서 다음 오류 메시지와 함께 400 오류가 반환됩니다.

    { "message": "Missing required request parameters: [petType]" }
POST 메서드에 대한 요청 검사를 구성하려면
  1. 기본 탐색 창에서 리소스를 선택하고 POST 메서드를 선택합니다.

  2. 메서드 요청 탭의 메서드 요청 설정에서 편집을 선택합니다.

  3. 요청 검사기에서 본문 검사를 선택합니다.

  4. 요청 본문에서 모델 추가를 선택합니다.

  5. 콘텐츠 유형에는 을 입력하고 application/json 모델에서는 을 선택합니다. PetStoreModel

  6. 저장을 선택합니다.

POST 메서드에 대한 요청 검사를 테스트하려면
  1. 테스트 탭을 선택합니다. 탭을 표시하려면 오른쪽 화살표 버튼을 선택해야 할 수도 있습니다.

  2. 요청 본문에서 다음을 코드 편집기에 붙여 넣습니다.

    { "id": 2, "name": "Bella", "type": "dog", "price": 400 }

    테스트를 선택합니다.

  3. 메서드 테스트에서 200 OK와 함께 성공 메시지가 반환됩니다.

  4. 요청 본문에서 다음을 코드 편집기에 붙여 넣습니다.

    { "id": 2, "name": "Bella", "type": "dog", "price": 4000 }

    테스트를 선택합니다.

  5. 메서드 테스트에서 다음 오류 메시지와 함께 400 오류가 반환됩니다.

    { "message": "Invalid request body" }

    테스트 로그 하단에 잘못된 요청 본문의 이유가 반환됩니다. 이 경우 반려동물의 가격이 모델에 명시된 최대 가격을 벗어났습니다.

AWS CloudFormation 스택을 삭제하려면
  1. https://console.aws.amazon.com/cloudformation 에서 AWS CloudFormation 콘솔을 엽니다.

  2. AWS CloudFormation 스택을 선택합니다.

  3. 삭제를 선택한 다음 해당 선택을 확인합니다.

다음 단계

를 사용하여 기본 요청 검증을 설정합니다. AWS CLI

AWS CLI를 사용하여 검사기를 만들어 요청 확인을 설정할 수 있습니다. 이 자습서를 따라하려면 AWS CloudFormation 템플릿을 사용하여 불완전한 API Gateway API를 생성해 보겠습니다.

참고

이 AWS CloudFormation 템플릿은 콘솔 자습서와 동일하지 않습니다.

미리 노출된 /validator 리소스를 사용하여 GETPOST 메서드를 생성합니다. 두 메서드 모두 http://petstore-demo-endpoint.execute-api.com/petstore/pets HTTP 엔드포인트와 통합됩니다. 다음과 같은 두 가지 요청 검사를 구성합니다.

  • GET 메서드에서 URL 쿼리 문자열 파라미터를 확인하는 params-only 검사기를 생성합니다.

  • POST 메서드에서 요청 본문을 확인하는 body-only 검사기를 생성합니다.

이렇게 하면 특정 API 호출만 API로 전달될 수 있습니다.

AWS CloudFormation 스택을 만들려면

의 앱 생성 템플릿을 다운로드하고 압축을 풉니다. AWS CloudFormation

다음 자습서를 완료하려면 AWS Command Line Interface (AWS CLI) 버전 2가 필요합니다.

긴 명령의 경우 이스케이프 문자(\)를 사용하여 명령을 여러 행으로 분할합니다.

참고

Windows에서는 일반적으로 사용하는 일부 Bash CLI 명령(예: zip)은 운영 체제의 기본 제공 터미널에서 지원되지 않습니다. Ubuntu와 Bash의 Windows 통합 버전을 가져오려면 Linux용 Windows Subsystem을 설치합니다. 이 안내서의 예제 CLI 명령은 Linux 형식을 사용합니다. Windows CLI를 사용하는 경우 인라인 JSON 문서를 포함하는 명령의 형식을 다시 지정해야 합니다.

  1. 다음 명령어를 사용하여 AWS CloudFormation 스택을 생성합니다.

    aws cloudformation create-stack --stack-name request-validation-tutorial-cli --template-body file://request-validation-tutorial-cli.zip --capabilities CAPABILITY_NAMED_IAM
  2. AWS CloudFormation 템플릿에 지정된 리소스를 프로비저닝합니다. 리소스 프로비저닝을 완료하는 데 몇 분 정도 걸릴 수 있습니다. 다음 명령을 사용하여 AWS CloudFormation 스택 상태를 확인합니다.

    aws cloudformation describe-stacks --stack-name request-validation-tutorial-cli
  3. AWS CloudFormation 스택 상태가 이면 StackStatus: "CREATE_COMPLETE" 다음 명령을 사용하여 향후 단계를 위한 관련 출력 값을 검색하십시오.

    aws cloudformation describe-stacks --stack-name request-validation-tutorial-cli --query "Stacks[*].Outputs[*].{OutputKey: OutputKey, OutputValue: OutputValue, Description: Description}"

    출력 값은 다음과 같습니다.

    • ApiId, API의 ID입니다. 이 자습서에서 API ID는 abc123입니다.

    • ResourceId, GETPOST 메서드가 노출되는 유효성 검사기 리소스의 ID입니다. 이 자습서에서 리소스 ID는 efg456입니다.

요청 검사기를 생성하고 모델을 가져오는 방법
  1. AWS CLI로 요청 확인을 사용하려면 검사기가 필요합니다. 다음 명령을 사용하여 요청 파라미터만 확인하는 검사기를 만듭니다.

    aws apigateway create-request-validator --rest-api-id abc123 \ --no-validate-request-body \ --validate-request-parameters \ --name params-only

    params-only 검사기의 ID를 기록해 둡니다.

  2. 다음 명령을 사용하여 요청 본문만 확인하는 검사기를 만듭니다.

    aws apigateway create-request-validator --rest-api-id abc123 \ --validate-request-body \ --no-validate-request-parameters \ --name body-only

    body-only 검사기의 ID를 기록해 둡니다.

  3. 수신 요청의 본문에서 요청 확인을 사용하려면 모델이 필요합니다. 다음 명령을 사용하여 모델을 가져옵니다.

    aws apigateway create-model --rest-api-id abc123 --name PetStoreModel --description 'My PetStore Model' --content-type 'application/json' --schema '{"type": "object", "required" : [ "name", "price", "type" ], "properties" : { "id" : {"type" : "integer"},"type" : {"type" : "string", "enum" : [ "dog", "cat", "fish" ]},"name" : { "type" : "string"},"price" : {"type" : "number","minimum" : 25.0, "maximum" : 500.0}}}}'

    일치하는 콘텐츠 유형이 없는 경우 요청 확인이 수행되지 않습니다. 콘텐츠 유형에 관계없이 동일한 모델을 사용하려면 $default을(를) 키로 지정합니다.

GET 및 POST 메서드를 생성하는 방법
  1. 다음 명령을 사용하여 /validate 리소스에 GET HTTP 메서드를 추가합니다. 이 명령은 GET 메서드를 만들고 params-only 검사기를 추가하며 필요에 따라 petType 쿼리 문자열을 설정합니다.

    aws apigateway put-method --rest-api-id abc123 \ --resource-id efg456 \ --http-method GET \ --authorization-type "NONE" \ --request-validator-id aaa111 \ --request-parameters "method.request.querystring.petType=true"

    다음 명령을 사용하여 /validate 리소스에 POST HTTP 메서드를 추가합니다. 이 명령은 POST 메서드를 만들고 body-only 검사기를 추가하며 모델을 본문 전용 검사기에 연결합니다.

    aws apigateway put-method --rest-api-id abc123 \ --resource-id efg456 \ --http-method POST \ --authorization-type "NONE" \ --request-validator-id bbb222 \ --request-models 'application/json'=PetStoreModel
  2. 다음 명령을 사용하여 GET /validate 메서드의 200 OK 응답을 설정합니다.

    aws apigateway put-method-response --rest-api-id abc123 \ --resource-id efg456 \ --http-method GET \ --status-code 200

    다음 명령을 사용하여 POST /validate 메서드의 200 OK 응답을 설정합니다.

    aws apigateway put-method-response --rest-api-id abc123 \ --resource-id efg456 \ --http-method POST \ --status-code 200
  3. 다음 명령을 사용하여 GET /validation 메서드에 지정된 HTTP 엔드포인트로 Integration을 설정합니다.

    aws apigateway put-integration --rest-api-id abc123 \ --resource-id efg456 \ --http-method GET \ --type HTTP \ --integration-http-method GET \ --request-parameters '{"integration.request.querystring.type" : "method.request.querystring.petType"}' \ --uri 'http://petstore-demo-endpoint.execute-api.com/petstore/pets'

    다음 명령을 사용하여 POST /validation 메서드에 지정된 HTTP 엔드포인트로 Integration을 설정합니다.

    aws apigateway put-integration --rest-api-id abc123 \ --resource-id efg456 \ --http-method POST \ --type HTTP \ --integration-http-method GET \ --uri 'http://petstore-demo-endpoint.execute-api.com/petstore/pets'
  4. 다음 명령을 사용하여 GET /validation 메서드 통합 응답을 설정합니다.

    aws apigateway put-integration-response --rest-api-id abc123 \ --resource-id efg456\ --http-method GET \ --status-code 200 \ --selection-pattern ""

    다음 명령을 사용하여 POST /validation 메서드 통합 응답을 설정합니다.

    aws apigateway put-integration-response --rest-api-id abc123 \ --resource-id efg456 \ --http-method POST \ --status-code 200 \ --selection-pattern ""
API를 테스트하려면
  1. 쿼리 문자열에 대한 요청 확인을 수행할 GET 메서드를 테스트하려면 다음 명령을 사용합니다.

    aws apigateway test-invoke-method --rest-api-id abc123 \ --resource-id efg456 \ --http-method GET \ --path-with-query-string '/validate?petType=dog'

    결과는 200 OK 및 반려견 목록을 반환합니다.

  2. petType 쿼리 문자열을 포함하지 않고 테스트하려면 다음 명령을 사용합니다.

    aws apigateway test-invoke-method --rest-api-id abc123 \ --resource-id efg456 \ --http-method GET

    결과는 400 오류를 반환합니다.

  3. 요청 본문에 대한 요청 확인을 수행할 POST 메서드를 테스트하려면 다음 명령을 사용합니다.

    aws apigateway test-invoke-method --rest-api-id abc123 \ --resource-id efg456 \ --http-method POST \ --body '{"id": 1, "name": "bella", "type": "dog", "price" : 400 }'

    결과는 200 OK 및 성공 메시지를 반환합니다.

  4. 다음 명령을 사용하여 잘못된 본문을 사용하여 테스트합니다.

    aws apigateway test-invoke-method --rest-api-id abc123 \ --resource-id efg456 \ --http-method POST \ --body '{"id": 1, "name": "bella", "type": "dog", "price" : 1000 }'

    반려견의 가격이 모델에서 정의한 최고 가격을 초과하므로 결과에 400 오류가 반환됩니다.

스택을 삭제하려면 AWS CloudFormation
  • 다음 명령어를 사용하여 AWS CloudFormation 리소스를 삭제합니다.

    aws cloudformation delete-stack --stack-name request-validation-tutorial-cli

OpenAPI 정의를 사용하여 기본 요청 확인 설정

요청의 어느 부분을 확인할지 선택하기 위해 x-amazon-apigateway-request- 유효성 검사기. 요청 유효성 검사기 개체 객체 세트를 x-amazon-apigateway-request-유효성 검사기 개체 맵에 지정하여 API 수준에서 요청 검사기를 선언할 수 있습니다. 예시 OpenAPI 정의에는 두 가지 검사기가 있습니다.

  • RequestBodyModel 데이터 모델을 사용하여 본문과 파라미터를 모두 확인하는 all 검사기

  • 파라미터만 확인하는 param-only 검사기

API의 모든 메서드에 대해 요청 검사기를 활성화하려면 API OpenAPI 정의의 API 수준에서 x-amazon-apigateway-request-유효성 검사기 속성 속성을 지정합니다. 예시 OpenAPI 정의의 경우, 달리 재정의되지 않는 한 all 검사기가 모든 API 메서드에 사용됩니다. 모델을 사용하여 본문을 확인할 때 일치하는 콘텐츠 유형이 없으면 요청 확인이 수행되지 않습니다. 콘텐츠 유형에 관계없이 동일한 모델을 사용하려면 $default을(를) 키로 지정합니다.

개별 메서드에 대해 요청 검사기를 활성화하려면 메서드 수준에서 x-amazon-apigateway-request-validator 속성을 지정합니다. 예시의 OpenAPI 정의에서는 param-only 검사기가 GET 메서드의 all 검사기를 덮어씁니다.

OpenAPI 예시를 API Gateway로 가져오려면 리전 API를 API Gateway로 가져오기 또는 엣지 최적화된 API를 API Gateway로 가져오기에 대한 다음 지침을 참조하세요.

OpenAPI 3.0
{ "openapi" : "3.0.1", "info" : { "title" : "ReqValidators Sample", "version" : "1.0.0" }, "servers" : [ { "url" : "/{basePath}", "variables" : { "basePath" : { "default" : "/v1" } } } ], "paths" : { "/validation" : { "get" : { "parameters" : [ { "name" : "q1", "in" : "query", "required" : true, "schema" : { "type" : "string" } } ], "responses" : { "200" : { "description" : "200 response", "headers" : { "test-method-response-header" : { "schema" : { "type" : "string" } } }, "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ArrayOfError" } } } } }, "x-amazon-apigateway-request-validator" : "params-only", "x-amazon-apigateway-integration" : { "httpMethod" : "GET", "uri" : "http://petstore-demo-endpoint.execute-api.com/petstore/pets", "responses" : { "default" : { "statusCode" : "400", "responseParameters" : { "method.response.header.test-method-response-header" : "'static value'" }, "responseTemplates" : { "application/xml" : "xml 400 response template", "application/json" : "json 400 response template" } }, "2\\d{2}" : { "statusCode" : "200" } }, "requestParameters" : { "integration.request.querystring.type" : "method.request.querystring.q1" }, "passthroughBehavior" : "when_no_match", "type" : "http" } }, "post" : { "parameters" : [ { "name" : "h1", "in" : "header", "required" : true, "schema" : { "type" : "string" } } ], "requestBody" : { "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/RequestBodyModel" } } }, "required" : true }, "responses" : { "200" : { "description" : "200 response", "headers" : { "test-method-response-header" : { "schema" : { "type" : "string" } } }, "content" : { "application/json" : { "schema" : { "$ref" : "#/components/schemas/ArrayOfError" } } } } }, "x-amazon-apigateway-request-validator" : "all", "x-amazon-apigateway-integration" : { "httpMethod" : "POST", "uri" : "http://petstore-demo-endpoint.execute-api.com/petstore/pets", "responses" : { "default" : { "statusCode" : "400", "responseParameters" : { "method.response.header.test-method-response-header" : "'static value'" }, "responseTemplates" : { "application/xml" : "xml 400 response template", "application/json" : "json 400 response template" } }, "2\\d{2}" : { "statusCode" : "200" } }, "requestParameters" : { "integration.request.header.custom_h1" : "method.request.header.h1" }, "passthroughBehavior" : "when_no_match", "type" : "http" } } } }, "components" : { "schemas" : { "RequestBodyModel" : { "required" : [ "name", "price", "type" ], "type" : "object", "properties" : { "id" : { "type" : "integer" }, "type" : { "type" : "string", "enum" : [ "dog", "cat", "fish" ] }, "name" : { "type" : "string" }, "price" : { "maximum" : 500.0, "minimum" : 25.0, "type" : "number" } } }, "ArrayOfError" : { "type" : "array", "items" : { "$ref" : "#/components/schemas/Error" } }, "Error" : { "type" : "object" } } }, "x-amazon-apigateway-request-validators" : { "all" : { "validateRequestParameters" : true, "validateRequestBody" : true }, "params-only" : { "validateRequestParameters" : true, "validateRequestBody" : false } } }
OpenAPI 2.0
{ "swagger" : "2.0", "info" : { "version" : "1.0.0", "title" : "ReqValidators Sample" }, "basePath" : "/v1", "schemes" : [ "https" ], "paths" : { "/validation" : { "get" : { "produces" : [ "application/json", "application/xml" ], "parameters" : [ { "name" : "q1", "in" : "query", "required" : true, "type" : "string" } ], "responses" : { "200" : { "description" : "200 response", "schema" : { "$ref" : "#/definitions/ArrayOfError" }, "headers" : { "test-method-response-header" : { "type" : "string" } } } }, "x-amazon-apigateway-request-validator" : "params-only", "x-amazon-apigateway-integration" : { "httpMethod" : "GET", "uri" : "http://petstore-demo-endpoint.execute-api.com/petstore/pets", "responses" : { "default" : { "statusCode" : "400", "responseParameters" : { "method.response.header.test-method-response-header" : "'static value'" }, "responseTemplates" : { "application/xml" : "xml 400 response template", "application/json" : "json 400 response template" } }, "2\\d{2}" : { "statusCode" : "200" } }, "requestParameters" : { "integration.request.querystring.type" : "method.request.querystring.q1" }, "passthroughBehavior" : "when_no_match", "type" : "http" } }, "post" : { "consumes" : [ "application/json" ], "produces" : [ "application/json", "application/xml" ], "parameters" : [ { "name" : "h1", "in" : "header", "required" : true, "type" : "string" }, { "in" : "body", "name" : "RequestBodyModel", "required" : true, "schema" : { "$ref" : "#/definitions/RequestBodyModel" } } ], "responses" : { "200" : { "description" : "200 response", "schema" : { "$ref" : "#/definitions/ArrayOfError" }, "headers" : { "test-method-response-header" : { "type" : "string" } } } }, "x-amazon-apigateway-request-validator" : "all", "x-amazon-apigateway-integration" : { "httpMethod" : "POST", "uri" : "http://petstore-demo-endpoint.execute-api.com/petstore/pets", "responses" : { "default" : { "statusCode" : "400", "responseParameters" : { "method.response.header.test-method-response-header" : "'static value'" }, "responseTemplates" : { "application/xml" : "xml 400 response template", "application/json" : "json 400 response template" } }, "2\\d{2}" : { "statusCode" : "200" } }, "requestParameters" : { "integration.request.header.custom_h1" : "method.request.header.h1" }, "passthroughBehavior" : "when_no_match", "type" : "http" } } } }, "definitions" : { "RequestBodyModel" : { "type" : "object", "required" : [ "name", "price", "type" ], "properties" : { "id" : { "type" : "integer" }, "type" : { "type" : "string", "enum" : [ "dog", "cat", "fish" ] }, "name" : { "type" : "string" }, "price" : { "type" : "number", "minimum" : 25.0, "maximum" : 500.0 } } }, "ArrayOfError" : { "type" : "array", "items" : { "$ref" : "#/definitions/Error" } }, "Error" : { "type" : "object" } }, "x-amazon-apigateway-request-validators" : { "all" : { "validateRequestParameters" : true, "validateRequestBody" : true }, "params-only" : { "validateRequestParameters" : true, "validateRequestBody" : false } } }