小编Abi*_*bie的帖子

AWS API Gateway 查询参数验证

我一直在尝试使用 x-amazon-apigateway-request-validator 验证我的请求参数,但不幸的是它不起作用。下面是 swagger 文件 -

{
  "swagger": "2.0",
  "info": {
    "title": "API Gateway - Request Validation Demo"
  },
  "schemes": [
    "https"
  ],
  "produces": [
    "application/json"
  ],
  "x-amazon-apigateway-request-validators" : {
    "full" : {
      "validateRequestBody" : true,
      "validateRequestParameters" : true
    },
    "body-only" : {
      "validateRequestBody" : true,
      "validateRequestParameters" : false
    }
  },
  "x-amazon-apigateway-request-validator" : "full",
  "paths": {
    "/orders": {
      "post": {
        "x-amazon-apigateway-request-validator": "body-only",
        "parameters": [
          {
            "in": "body",
            "name": "CreateOrders",
            "required": true,
            "schema": {
              "$ref": "#/definitions/CreateOrders"
            }
          }
        ],
        "responses": { …
Run Code Online (Sandbox Code Playgroud)

api aws-api-gateway

4
推荐指数
1
解决办法
3220
查看次数

标签 统计

api ×1

aws-api-gateway ×1