Amazon web services AWS API网关无法导入招摇定义:不支持的模型类型“MapProperty”
我目前正在这个屏幕上尝试导入我的应用程序的招摇过市定义,以便创建一个API网关实例 不幸的是,你可以看到我犯了一些错误——尽管斯威格似乎认为这是完全正确的Amazon web services AWS API网关无法导入招摇定义:不支持的模型类型“MapProperty”,amazon-web-services,swagger,aws-api-gateway,openapi,swagger-2.0,Amazon Web Services,Swagger,Aws Api Gateway,Openapi,Swagger 2.0,我目前正在这个屏幕上尝试导入我的应用程序的招摇过市定义,以便创建一个API网关实例 不幸的是,你可以看到我犯了一些错误——尽管斯威格似乎认为这是完全正确的 Your API was not imported due to errors in the Swagger file. Unable to create model for 200 response to method 'GET /api/v1/courses': Validation Result: warnings : [], erro
Your API was not imported due to errors in the Swagger file.
Unable to create model for 200 response to method 'GET /api/v1/courses': Validation Result: warnings : [], errors : [Invalid content type specified: */*]
Unsupported model type 'MapProperty' in 200 response to method 'GET /api/v1/courses/all'. Ignoring.
以下是我对昂首阔步的定义:
{
"swagger": "2.0",
"info": {
"description": "Api Documentation",
"version": "1.0",
"title": "Api Documentation",
"termsOfService": "urn:tos",
"contact": {},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0"
}
},
"host": "********.appspot.com",
"basePath": "/",
"tags": [{
"name": "course-controller",
"description": "Course Controller"
}],
"paths": {
"/api/v1/courses": {
"get": {
"tags": ["course-controller"],
"summary": "getCourses",
"operationId": "getCoursesUsingGET",
"produces": ["*/*"],
"parameters": [{
"name": "code",
"in": "query",
"description": "code",
"required": false,
"type": "string"
}],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Course"
}
}
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
},
"404": {
"description": "Not Found"
}
},
"deprecated": false
}
},
"/api/v1/courses/all": {
"get": {
"tags": ["course-controller"],
"summary": "getAllCourses",
"operationId": "getAllCoursesUsingGET",
"produces": ["*/*"],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "object",
"additionalProperties": {
"type": "object"
}
}
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
},
"404": {
"description": "Not Found"
}
},
"deprecated": false
}
}
},
"definitions": {
"Course": {
"type": "object",
"properties": {
"code": {
"type": "string"
},
"credits": {
"type": "integer",
"format": "int32"
},
"id": {
"type": "integer",
"format": "int32"
},
"lastUpdated": {
"type": "string"
},
"name": {
"type": "string"
},
"prerequisites": {
"type": "string"
},
"restrictions": {
"type": "string"
},
"seats": {
"$ref": "#/definitions/Seats"
},
"waitlist": {
"$ref": "#/definitions/Seats"
}
},
"title": "Course"
},
"Seats": {
"type": "object",
"properties": {
"actual": {
"type": "integer",
"format": "int32"
},
"capacity": {
"type": "integer",
"format": "int32"
},
"remaining": {
"type": "integer",
"format": "int32"
}
},
"title": "Seats"
}
}
}
有没有什么原因可以让API Gateway中的这个夸张定义被打破?AWS API Gateway在其OpenAPI支持中提供了支持。例如,它不支持模型中的附加属性此关键字用于api中/api/v1/courses/all端点的200响应模式中
您可以单击“导入并忽略警告”按钮来忽略这些错误并继续导入。AWS API网关的OpenAPI支持中有。例如,它不支持模型中的附加属性此关键字用于api中/api/v1/courses/all端点的200响应模式中
您可以单击“导入并忽略警告”按钮忽略这些错误并继续导入。相关或重复:相关或重复: