У меня проблемы с использованием наследования с чванством. У меня есть следующее:
{
"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"
}
}
}
]
}
}
}
Когда я вижу пользовательский интерфейс и нажимаю «Попробовать это», я ожидаю увидеть поля для ExtendedErrorModel. Однако я просто вижу следующее, что неверно:
Как видите, типы данных кажутся правильными.
Однако, когда вы посмотрите на поля try this, вы заметите два поля запроса (вместо одного) и ExtendedErrorModel, представляющий собой пустой раскрывающийся список.
Сайт: http://editor.swagger.io/#/
Любые советы приветствуются, спасибо, D