[英]Azure APi Management Split schema definition in multiple ARM template
[英]Azure API Management Schema ARM Template import error
我在ARM模板中定義了以下架構:
{
"name": "[concat(variables('api-v1-operation-prefix'), '/', variables('schema-v1-report-name'))]",
"type": "Microsoft.ApiManagement/service/apis/schemas",
"apiVersion": "2018-01-01",
"properties": {
"contentType": "application/json",
"document": {
"value": "[concat('{\r\n \"', variables('schema-v1-report-name'), '\": {\r\n \"type\": \"object\",\r\n \"required\": [\r\n \"Email\",\r\n \"LastName\",\r\n \"Zip\",\r\n \"Subject\",\r\n \"Message\",\r\n \"CategoryId\",\r\n \"SubcategoryId\",\r\n \"RequestTypeInt\"\r\n ],\r\n \"properties\": {\r\n \"FirstName\": {\r\n \"type\": \"string\"\r\n },\r\n \"LastName\": {\r\n \"type\": \"string\"\r\n },\r\n \"Email\": {\r\n \"type\": \"string\"\r\n },\r\n \"Phone\": {\r\n \"type\": \"string\"\r\n },\r\n \"Zip\": {\r\n \"type\": \"string\"\r\n },\r\n \"Subject\": {\r\n \"type\": \"string\"\r\n },\r\n \"Message\": {\r\n \"type\": \"string\"\r\n },\r\n \"CategoryId\": {\r\n \"type\": \"string\"\r\n },\r\n \"SubcategoryId\": {\r\n \"type\": \"string\"\r\n },\r\n \"RequestTypeInt\": {\r\n \"type\": \"number\"\r\n },\r\n \"WantsEmailResponse\": {\r\n \"type\": \"boolean\"\r\n }\r\n }\r\n }\r\n}')]"
}
}
}
部署ARM模板時,無法正確導入架構,並且在Azure門戶的OpenAPI規范視圖中看到以下錯誤:
x-ms-export-notes:->-導出的API包含的架構不是內容類型“ application / vnd.ms-azure-apim.swagger.definitions + json”,因此不會作為Swagger定義導出。
我遵循基於Joy Wang鏈接的ARM模板。 這讓我有90%的路途。 問題在於,對於每個操作的schemaId,我使用了定義名稱(或類型名稱),但它應該是架構資源的ID。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.