AWS Api Gateway无效的模型架构

时间:2018-03-28 16:49:32

标签: aws-api-gateway jsonmodel

我正在尝试为我的api创建一个模型。但是aws返回3x无效的模型模式错误,无法找出原因:

{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "EmailInputModel",
"type":"object",
"properties":{
"email":{
    "type":"string",
    "required":true,
    "patternProperties":{ 
        "^((\"[\\w-\\s]+\")|([\\w-]+(?:\\.[\\w-]+)*)|(\"[\\w-\\s]+\")([\\w-]+(?:\\.[\\w-]+)*))(@((?:[\\w-]+\\.)*\\w[\\w-]{0,66})\\.([a-z]{2,6}(?:\\.[a-z]{2})?)$)|(@\\[?((25[0-5]\\.|2[0-4][0-9]\\.|1[0-9]{2}\\.|[0-9]{1,2}\\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\\]?$)/i": {}
        }
    },
"message":{
    "type":"string",
    "required":true
},
"sender":{
    "type":"string",
    "required":true
}
}

}

提前感谢您的帮助和努力。

1 个答案:

答案 0 :(得分:0)

看起来好像必须使用required属性。请尝试以下。

stm
相关问题