У меня проблема с Azure API Management. Когда я пытаюсь извлечь следующий swagger в шаблон arm (с "/ a-path" и "/ a-path / id"):
"/v2.5/Repositories/DudeCorporation/Context/Asset": {
"options": {
"tags": [ "Asset" ],
"description": "Options for Asset",
"operationId": "0ea7ccb3-e249-4001-9452-3f488cc20811",
"consumes": [ "application/json" ],
"produces": [ "application/json" ],
"parameters": [
],
"responses": {
"200": { "description": "OK" },
"400": {
"description": "Bad request",
"schema": { "$ref": "#/definitions/ErrorSchema" }
},
"403": {
"description": "Forbidden",
"schema": { "$ref": "#/definitions/ErrorSchema" }
},
"500": {
"description": "Internal server error",
"schema": { "$ref": "#/definitions/ErrorSchema" }
},
"404": {
"description": "Not found",
"schema": { "$ref": "#/definitions/ErrorSchema" }
},
"503": {
"description": "Service unavailable",
"schema": { "$ref": "#/definitions/ErrorSchema" }
},
"401": {
"description": "Unauthorized",
"schema": { "$ref": "#/definitions/ErrorSchema" }
}
}
},
}
"/v2.5/Repositories/DudeCorporation/Context/Asset/{instanceId}/": {
"options": {
"tags": [ "Asset" ],
"description": "Options for Asset",
"operationId": "f13cfc5b-61ec-448a-add5-f66b7feb561d",
"consumes": [ "application/json" ],
"produces": [ "application/json" ],
"parameters": [
{
"name": "instanceId",
"in": "path",
"required": true,
"type": "string"
}
],
"responses": {
"200": { "description": "OK" },
"400": {
"description": "Bad request",
"schema": { "$ref": "#/definitions/ErrorSchema" }
},
"403": {
"description": "Forbidden",
"schema": { "$ref": "#/definitions/ErrorSchema" }
},
"500": {
"description": "Internal server error",
"schema": { "$ref": "#/definitions/ErrorSchema" }
},
"404": {
"description": "Not found",
"schema": { "$ref": "#/definitions/ErrorSchema" }
},
"503": {
"description": "Service unavailable",
"schema": { "$ref": "#/definitions/ErrorSchema" }
},
"401": {
"description": "Unauthorized",
"schema": { "$ref": "#/definitions/ErrorSchema" }
}
}
},
}
Следующая ошибка возникает только для операций OPTIONS. Это происходит, когда у нас есть похожие пути, такие как "/ a-path" и "/ a-path / {id}". Ошибка:
"error": { "code": "ValidationError",
"message": "One or more fields contain incorrect values:",
"details": [ { "code": "ValidationError",
"target": "urlTemplate",
"message": "Operation with the same method and URL template already exists"},{"code":"ValidationError",
"target": "method", "message": "Operation with the same method and URL template already exists" } ] }
Мы не получаем ошибку для той же ситуации с другими HTTP-глаголами. Кажется, что для других HTTP-глаголов они (method + urlTemplate) считаются уникальными, но не с OPTIONS. Почему?