我在使用带有招摇的继承时遇到问题。我有以下内容:
{
"swagger": "2.0",
"info": {
"title": "Uber API",
"description": "Move your app forward with the Uber API",
"version": "1.0.0"
},
"host": "api.uber.com",
"schemes": [
"https"
],
"basePath": "/v1",
"produces": [
"application/json"
],
"paths": {
"/products": {
"post": {
"summary": "Product Types",
"description": "The Products endpoint returns information about the *Uber* products\noffered at a given location. The response includes the display name\nand other details about each product, and lists the products in the\nproper display order.\n",
"parameters": [
{
"name": "error",
"in": "body",
"description": "Latitude component of location.",
"required": true,
"type": "",
"schema": {
"$ref": "#/definitions/ExtendedErrorModel"
}
}
],
"tags": [
"Products"
],
}
}
},
"definitions": {
"ErrorModel": {
"type": "object",
"required": [
"message",
"code"
],
"properties": {
"message": {
"type": "string"
},
"code": {
"type": "integer",
"minimum": 100,
"maximum": 600
}
}
},
"ExtendedErrorModel": {
"allOf": [
{
"$ref": "#/definitions/ErrorModel"
},
{
"type": "object",
"required": [
"rootCause"
],
"properties": {
"rootCause": {
"type": "string"
}
}
}
]
}
}
}
当我看到 UI 并单击“试试这个”时,我希望看到 ExtendedErrorModel 的字段。但是,我只看到以下不正确的内容:
如您所见,数据类型似乎正确。
但是,当您查看 try this 框时,您会注意到两个请求框(而不是一个)并且 ExtendedErrorModel 是一个空白下拉框
网站:http ://editor.swagger.io/#/
任何建议表示赞赏,谢谢,D