From 7e532650b602ef1088f6b049bfbdd1cdd474fbf4 Mon Sep 17 00:00:00 2001 From: Xuyang Cao Date: Wed, 6 Mar 2024 16:04:40 +0800 Subject: [PATCH 01/14] Make the JavaComponent definitions polymorphism --- .../2024-02-02-preview/JavaComponents.json | 205 +++++++++++++----- .../JavaComponents_CreateOrUpdate.json | 11 +- .../examples/JavaComponents_List.json | 8 +- .../examples/JavaComponents_Patch.json | 8 +- 4 files changed, 167 insertions(+), 65 deletions(-) diff --git a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json index cf08c6aef653..a2e34864d0c0 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json @@ -2,7 +2,7 @@ "swagger": "2.0", "info": { "title": "ContainerApps API Client", - "version": "2024-02-02-preview" + "version": "2023-11-02-preview" }, "schemes": [ "https" @@ -69,7 +69,7 @@ "default": { "description": "Common error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse" } } }, @@ -130,7 +130,7 @@ "default": { "description": "Common error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse" } } }, @@ -202,7 +202,7 @@ "default": { "description": "Common error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse" } } }, @@ -280,7 +280,7 @@ "default": { "description": "Common error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse" } } }, @@ -343,7 +343,7 @@ "default": { "description": "Common error response.", "schema": { - "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" + "$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse" } } }, @@ -401,61 +401,150 @@ "properties": { "description": "Java Component resource specific properties", "type": "object", - "properties": { - "componentType": { - "description": "Type of the Java Component.", - "enum": [ - "SpringBootAdmin", - "SpringCloudEureka", - "SpringCloudConfig" - ], - "type": "string", - "x-ms-enum": { - "name": "JavaComponentType", - "modelAsString": true - } - }, - "provisioningState": { - "description": "Provisioning state of the Java Component.", - "enum": [ - "Succeeded", - "Failed", - "Canceled", - "Deleting", - "InProgress" - ], - "type": "string", - "readOnly": true, - "x-ms-enum": { - "name": "JavaComponentProvisioningState", - "modelAsString": true - } - }, - "configurations": { - "description": "List of Java Components configuration properties", - "type": "array", - "items": { - "$ref": "#/definitions/JavaComponentConfigurationProperty" - }, - "x-ms-identifiers": [ - "propertyName" - ] - }, - "serviceBinds": { - "description": "List of Java Components that are bound to the Java component", - "type": "array", - "items": { - "$ref": "#/definitions/JavaComponentServiceBind" - }, - "x-ms-identifiers": [ - "name" - ] - } - }, - "x-ms-client-flatten": true + "$ref": "#/definitions/JavaComponentProperties" } } }, + "JavaComponentProperties": { + "description": "Java Component common properties.", + "type": "object", + "required": [ + "componentType" + ], + "properties": { + "componentType": { + "description": "Type of the Java Component.", + "enum": [ + "SpringBootAdmin", + "SpringCloudEureka", + "SpringCloudConfig" + ], + "type": "string", + "x-ms-enum": { + "name": "JavaComponentType", + "modelAsString": true + } + }, + "provisioningState": { + "description": "Provisioning state of the Java Component.", + "enum": [ + "Succeeded", + "Failed", + "Canceled", + "Deleting", + "InProgress" + ], + "type": "string", + "readOnly": true, + "x-ms-enum": { + "name": "JavaComponentProvisioningState", + "modelAsString": true + } + }, + "configurations": { + "description": "List of Java Components configuration properties", + "type": "array", + "items": { + "$ref": "#/definitions/JavaComponentConfigurationProperty" + }, + "x-ms-identifiers": [ + "propertyName" + ] + }, + "serviceBinds": { + "description": "List of Java Components that are bound to the Java component", + "type": "array", + "items": { + "$ref": "#/definitions/JavaComponentServiceBind" + }, + "x-ms-identifiers": [ + "name" + ] + } + }, + "x-ms-client-flatten": true, + "discriminator": "componentType" + }, + "SpringBootAdminComponent": { + "description": "Spring Boot Admin properties.", + "type": "object", + "required": [ + "componentType" + ], + "allOf": [ + { + "$ref": "#/definitions/JavaComponentProperties" + } + ], + "properties": { + "fqdn": { + "description": "Hostname of the Java Component endpoint", + "type": "string", + "readOnly": true + }, + "httpEndpoint": { + "description": "Whether the Java Component exposes an external http endpoint", + "default": false, + "enum": [ + "External", + "Internal" + ], + "type": "string", + "x-ms-enum": { + "name": "HttpEndpointEnum", + "modelAsString": true + } + } + }, + "x-ms-discriminator-value": "SpringBootAdmin" + }, + "SpringCloudEurekaComponent": { + "description": "Spring Cloud Eureka properties.", + "type": "object", + "required": [ + "componentType" + ], + "allOf": [ + { + "$ref": "#/definitions/JavaComponentProperties" + } + ], + "properties": { + "fqdn": { + "description": "Hostname of the Java Component endpoint", + "type": "string", + "readOnly": true + }, + "httpEndpoint": { + "description": "Whether the Java Component exposes an external http endpoint", + "default": false, + "enum": [ + "External", + "Internal" + ], + "type": "string", + "x-ms-enum": { + "name": "HttpEndpointEnum", + "modelAsString": true + } + } + }, + "x-ms-discriminator-value": "SpringCloudEureka" + }, + "SpringCloudConfigComponent": { + "description": "Spring Cloud Config properties.", + "type": "object", + "required": [ + "componentType" + ], + "allOf": [ + { + "$ref": "#/definitions/JavaComponentProperties" + } + ], + "properties": {}, + "x-ms-discriminator-value": "SpringCloudConfig" + }, "JavaComponentsCollection": { "description": "Java Components ARM resource.", "required": [ diff --git a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_CreateOrUpdate.json b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_CreateOrUpdate.json index edf1bea595dd..b2bdb8578c20 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_CreateOrUpdate.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_CreateOrUpdate.json @@ -17,7 +17,8 @@ "propertyName": "spring.boot.admin.monitor.status-interval", "value": "10000ms" } - ] + ], + "httpEndpoint": "External" } } }, @@ -40,7 +41,9 @@ "propertyName": "spring.boot.admin.monitor.status-interval", "value": "10000ms" } - ] + ], + "httpEndpoint": "External", + "fqdn": "myjavacomponent.myenvironment.test.net" } } }, @@ -62,7 +65,9 @@ "propertyName": "spring.boot.admin.monitor.status-interval", "value": "10000ms" } - ] + ], + "httpEndpoint": "External", + "fqdn": "myjavacomponent.myenvironment.test.net" } } } diff --git a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_List.json b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_List.json index 85799cf5d894..c26d843137f1 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_List.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_List.json @@ -25,7 +25,9 @@ "propertyName": "spring.boot.admin.monitor.status-interval", "value": "10000ms" } - ] + ], + "httpEndpoint": "External", + "fqdn": "myjavacomponent.myenvironment.test.net" } }, { @@ -40,7 +42,9 @@ "propertyName": "spring.cloud.config.server.git.uri", "value": "" } - ] + ], + "httpEndpoint": "External", + "fqdn": "myjavacomponent.myenvironment.test.net" } } ] diff --git a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_Patch.json b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_Patch.json index 8af43421ce49..fe8815a38c0e 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_Patch.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_Patch.json @@ -17,7 +17,9 @@ "propertyName": "spring.boot.admin.monitor.status-interval", "value": "10000ms" } - ] + ], + "httpEndpoint": "External", + "fqdn": "myjavacomponent.myenvironment.test.net" } } }, @@ -40,7 +42,9 @@ "propertyName": "spring.boot.admin.monitor.status-interval", "value": "10000ms" } - ] + ], + "httpEndpoint": "External", + "fqdn": "myjavacomponent.myenvironment.test.net" } } }, From 53aa7136c943fd4297ffd245d791ec2b1b152631 Mon Sep 17 00:00:00 2001 From: Xuyang Cao Date: Wed, 6 Mar 2024 16:30:25 +0800 Subject: [PATCH 02/14] fix api version --- .../preview/2024-02-02-preview/JavaComponents.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json index a2e34864d0c0..1a4bb05f5256 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json @@ -2,7 +2,7 @@ "swagger": "2.0", "info": { "title": "ContainerApps API Client", - "version": "2023-11-02-preview" + "version": "2024-02-02-preview" }, "schemes": [ "https" From b8b5dbe621491c227c387731f833dd249b9eda81 Mon Sep 17 00:00:00 2001 From: Xuyang Cao Date: Wed, 6 Mar 2024 16:33:52 +0800 Subject: [PATCH 03/14] revert error response change --- .../preview/2024-02-02-preview/JavaComponents.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json index 1a4bb05f5256..8029e94f3d3e 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json @@ -69,7 +69,7 @@ "default": { "description": "Common error response.", "schema": { - "$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -130,7 +130,7 @@ "default": { "description": "Common error response.", "schema": { - "$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -202,7 +202,7 @@ "default": { "description": "Common error response.", "schema": { - "$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -280,7 +280,7 @@ "default": { "description": "Common error response.", "schema": { - "$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, @@ -343,7 +343,7 @@ "default": { "description": "Common error response.", "schema": { - "$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse" + "$ref": "../../../../../common-types/resource-management/v5/types.json#/definitions/ErrorResponse" } } }, From 13bd85ce681306d647293c0c7cc52c8319d94d37 Mon Sep 17 00:00:00 2001 From: Xuyang Cao Date: Wed, 6 Mar 2024 17:04:32 +0800 Subject: [PATCH 04/14] refine examples --- .../2024-02-02-preview/examples/JavaComponents_Get.json | 4 +++- .../2024-02-02-preview/examples/JavaComponents_Patch.json | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_Get.json b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_Get.json index e6ba3bd16d6a..2fa7c604009e 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_Get.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_Get.json @@ -25,7 +25,9 @@ "propertyName": "spring.boot.admin.monitor.status-interval", "value": "10000ms" } - ] + ], + "httpEndpoint": "External", + "fqdn": "myjavacomponent.myenvironment.test.net" } } } diff --git a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_Patch.json b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_Patch.json index fe8815a38c0e..de199f1175da 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_Patch.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_Patch.json @@ -18,8 +18,7 @@ "value": "10000ms" } ], - "httpEndpoint": "External", - "fqdn": "myjavacomponent.myenvironment.test.net" + "httpEndpoint": "External" } } }, From 33c5178905679b63f45f68587d5d4094c37d894a Mon Sep 17 00:00:00 2001 From: Xuyang Cao Date: Thu, 7 Mar 2024 12:27:48 +0800 Subject: [PATCH 05/14] fix default value --- .../preview/2024-02-02-preview/JavaComponents.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json index 8029e94f3d3e..54b37a14dc56 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json @@ -484,7 +484,7 @@ }, "httpEndpoint": { "description": "Whether the Java Component exposes an external http endpoint", - "default": false, + "default": "Internal", "enum": [ "External", "Internal" From 025f12dad1a9cea19516af56db5f29a7bf9fc350 Mon Sep 17 00:00:00 2001 From: Xuyang Cao Date: Thu, 7 Mar 2024 12:37:45 +0800 Subject: [PATCH 06/14] fix --- .../preview/2024-02-02-preview/JavaComponents.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json index 54b37a14dc56..9b32d399efbf 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json @@ -517,7 +517,7 @@ }, "httpEndpoint": { "description": "Whether the Java Component exposes an external http endpoint", - "default": false, + "default": "Internal", "enum": [ "External", "Internal" From 4c37d979f073c6489c073e842892ae3432f642eb Mon Sep 17 00:00:00 2001 From: Xuyang Cao Date: Thu, 7 Mar 2024 12:42:52 +0800 Subject: [PATCH 07/14] fix --- .../preview/2024-02-02-preview/JavaComponents.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json index 9b32d399efbf..34fe38fc78c5 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json @@ -423,7 +423,11 @@ "x-ms-enum": { "name": "JavaComponentType", "modelAsString": true - } + }, + "x-ms-mutability": [ + "create", + "read" + ] }, "provisioningState": { "description": "Provisioning state of the Java Component.", From cbe33a56b79ce96b0ac8996b9f45be02f64c7d2a Mon Sep 17 00:00:00 2001 From: Xuyang Cao Date: Thu, 7 Mar 2024 13:02:49 +0800 Subject: [PATCH 08/14] try to remove required --- .../preview/2024-02-02-preview/JavaComponents.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json index 34fe38fc78c5..a7891483de31 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json @@ -408,9 +408,6 @@ "JavaComponentProperties": { "description": "Java Component common properties.", "type": "object", - "required": [ - "componentType" - ], "properties": { "componentType": { "description": "Type of the Java Component.", From 1a920861053a8f1ce69bfd0380c6dfe50808aa72 Mon Sep 17 00:00:00 2001 From: Xuyang Cao Date: Thu, 7 Mar 2024 13:21:12 +0800 Subject: [PATCH 09/14] try remove require in patch body --- .../2024-02-02-preview/JavaComponents.json | 82 +++++++++++++++++-- 1 file changed, 77 insertions(+), 5 deletions(-) diff --git a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json index a7891483de31..ed98c8737e69 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json @@ -258,7 +258,7 @@ "description": "Configuration details of the Java Component.", "required": true, "schema": { - "$ref": "#/definitions/JavaComponent" + "$ref": "#/definitions/JavaComponentForPatch" } } ], @@ -405,7 +405,23 @@ } } }, - "JavaComponentProperties": { + "JavaComponentForPatch": { + "description": "Java Component.", + "type": "object", + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ProxyResource" + } + ], + "properties": { + "properties": { + "description": "Java Component resource specific properties", + "type": "object", + "$ref": "#/definitions/JavaComponentPropertiesForPatch" + } + } + }, + "JavaComponentPropertiesForPatch": { "description": "Java Component common properties.", "type": "object", "properties": { @@ -420,12 +436,68 @@ "x-ms-enum": { "name": "JavaComponentType", "modelAsString": true + } + }, + "provisioningState": { + "description": "Provisioning state of the Java Component.", + "enum": [ + "Succeeded", + "Failed", + "Canceled", + "Deleting", + "InProgress" + ], + "type": "string", + "readOnly": true, + "x-ms-enum": { + "name": "JavaComponentProvisioningState", + "modelAsString": true + } + }, + "configurations": { + "description": "List of Java Components configuration properties", + "type": "array", + "items": { + "$ref": "#/definitions/JavaComponentConfigurationProperty" }, - "x-ms-mutability": [ - "create", - "read" + "x-ms-identifiers": [ + "propertyName" ] }, + "serviceBinds": { + "description": "List of Java Components that are bound to the Java component", + "type": "array", + "items": { + "$ref": "#/definitions/JavaComponentServiceBind" + }, + "x-ms-identifiers": [ + "name" + ] + } + }, + "x-ms-client-flatten": true, + "discriminator": "componentType" + }, + "JavaComponentProperties": { + "description": "Java Component common properties.", + "type": "object", + "required": [ + "componentType" + ], + "properties": { + "componentType": { + "description": "Type of the Java Component.", + "enum": [ + "SpringBootAdmin", + "SpringCloudEureka", + "SpringCloudConfig" + ], + "type": "string", + "x-ms-enum": { + "name": "JavaComponentType", + "modelAsString": true + } + }, "provisioningState": { "description": "Provisioning state of the Java Component.", "enum": [ From ba95e6ed04eb9eff9de2dc8ba17f0308b5a07eb4 Mon Sep 17 00:00:00 2001 From: Xuyang Cao Date: Thu, 7 Mar 2024 13:28:07 +0800 Subject: [PATCH 10/14] fix --- .../2024-02-02-preview/JavaComponents.json | 75 +------------------ 1 file changed, 1 insertion(+), 74 deletions(-) diff --git a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json index ed98c8737e69..9b32d399efbf 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json @@ -258,7 +258,7 @@ "description": "Configuration details of the Java Component.", "required": true, "schema": { - "$ref": "#/definitions/JavaComponentForPatch" + "$ref": "#/definitions/JavaComponent" } } ], @@ -405,79 +405,6 @@ } } }, - "JavaComponentForPatch": { - "description": "Java Component.", - "type": "object", - "allOf": [ - { - "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ProxyResource" - } - ], - "properties": { - "properties": { - "description": "Java Component resource specific properties", - "type": "object", - "$ref": "#/definitions/JavaComponentPropertiesForPatch" - } - } - }, - "JavaComponentPropertiesForPatch": { - "description": "Java Component common properties.", - "type": "object", - "properties": { - "componentType": { - "description": "Type of the Java Component.", - "enum": [ - "SpringBootAdmin", - "SpringCloudEureka", - "SpringCloudConfig" - ], - "type": "string", - "x-ms-enum": { - "name": "JavaComponentType", - "modelAsString": true - } - }, - "provisioningState": { - "description": "Provisioning state of the Java Component.", - "enum": [ - "Succeeded", - "Failed", - "Canceled", - "Deleting", - "InProgress" - ], - "type": "string", - "readOnly": true, - "x-ms-enum": { - "name": "JavaComponentProvisioningState", - "modelAsString": true - } - }, - "configurations": { - "description": "List of Java Components configuration properties", - "type": "array", - "items": { - "$ref": "#/definitions/JavaComponentConfigurationProperty" - }, - "x-ms-identifiers": [ - "propertyName" - ] - }, - "serviceBinds": { - "description": "List of Java Components that are bound to the Java component", - "type": "array", - "items": { - "$ref": "#/definitions/JavaComponentServiceBind" - }, - "x-ms-identifiers": [ - "name" - ] - } - }, - "x-ms-client-flatten": true, - "discriminator": "componentType" - }, "JavaComponentProperties": { "description": "Java Component common properties.", "type": "object", From 96146134dc3c81cb2b67a345bfc8c11252c0e2b3 Mon Sep 17 00:00:00 2001 From: Xuyang Cao Date: Sat, 9 Mar 2024 10:26:56 +0800 Subject: [PATCH 11/14] try fix lint --- .../preview/2024-02-02-preview/JavaComponents.json | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json index 9b32d399efbf..c7701e1acf9f 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json @@ -408,9 +408,6 @@ "JavaComponentProperties": { "description": "Java Component common properties.", "type": "object", - "required": [ - "componentType" - ], "properties": { "componentType": { "description": "Type of the Java Component.", @@ -468,9 +465,6 @@ "SpringBootAdminComponent": { "description": "Spring Boot Admin properties.", "type": "object", - "required": [ - "componentType" - ], "allOf": [ { "$ref": "#/definitions/JavaComponentProperties" @@ -501,9 +495,6 @@ "SpringCloudEurekaComponent": { "description": "Spring Cloud Eureka properties.", "type": "object", - "required": [ - "componentType" - ], "allOf": [ { "$ref": "#/definitions/JavaComponentProperties" @@ -534,9 +525,6 @@ "SpringCloudConfigComponent": { "description": "Spring Cloud Config properties.", "type": "object", - "required": [ - "componentType" - ], "allOf": [ { "$ref": "#/definitions/JavaComponentProperties" From 973883d55ac1103c3f999f7453bfc91890ed192d Mon Sep 17 00:00:00 2001 From: Xuyang Cao Date: Sat, 9 Mar 2024 10:38:33 +0800 Subject: [PATCH 12/14] fix --- .../preview/2024-02-02-preview/JavaComponents.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json index c7701e1acf9f..5e098cf19da9 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json @@ -408,6 +408,9 @@ "JavaComponentProperties": { "description": "Java Component common properties.", "type": "object", + "required": [ + "componentType" + ], "properties": { "componentType": { "description": "Type of the Java Component.", From 0683348b2a2be64408f5dee2daddea45b40075d6 Mon Sep 17 00:00:00 2001 From: Xuyang Cao Date: Tue, 12 Mar 2024 10:24:46 +0800 Subject: [PATCH 13/14] add suppression for discriminator --- .../2024-02-02-preview/JavaComponents.json | 68 +++++++++---------- .../JavaComponents_CreateOrUpdate.json | 13 ++-- .../examples/JavaComponents_Get.json | 5 +- .../examples/JavaComponents_List.json | 10 +-- .../examples/JavaComponents_Patch.json | 8 +-- specification/app/resource-manager/readme.md | 5 ++ 6 files changed, 59 insertions(+), 50 deletions(-) diff --git a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json index 5e098cf19da9..e56a3670b6ab 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json @@ -418,6 +418,7 @@ "SpringBootAdmin", "SpringCloudEureka", "SpringCloudConfig" + "Nacos", ], "type": "string", "x-ms-enum": { @@ -465,6 +466,17 @@ "x-ms-client-flatten": true, "discriminator": "componentType" }, + "JavaComponentIngress": { + "description": "Container App Ingress configuration.", + "type": "object", + "properties": { + "fqdn": { + "description": "Hostname of the Java Component endpoint", + "type": "string", + "readOnly": true + } + } + }, "SpringBootAdminComponent": { "description": "Spring Boot Admin properties.", "type": "object", @@ -474,27 +486,29 @@ } ], "properties": { - "fqdn": { - "description": "Hostname of the Java Component endpoint", - "type": "string", - "readOnly": true - }, - "httpEndpoint": { - "description": "Whether the Java Component exposes an external http endpoint", - "default": "Internal", - "enum": [ - "External", - "Internal" - ], - "type": "string", - "x-ms-enum": { - "name": "HttpEndpointEnum", - "modelAsString": true - } + "ingress": { + "$ref": "#/definitions/JavaComponentIngress", + "description": "Java Component Ingress configurations." } }, "x-ms-discriminator-value": "SpringBootAdmin" }, + "NacosComponent": { + "description": "Nacos properties.", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/JavaComponentProperties" + } + ], + "properties": { + "ingress": { + "$ref": "#/definitions/JavaComponentIngress", + "description": "Java Component Ingress configurations." + } + }, + "x-ms-discriminator-value": "Nacos" + }, "SpringCloudEurekaComponent": { "description": "Spring Cloud Eureka properties.", "type": "object", @@ -504,23 +518,9 @@ } ], "properties": { - "fqdn": { - "description": "Hostname of the Java Component endpoint", - "type": "string", - "readOnly": true - }, - "httpEndpoint": { - "description": "Whether the Java Component exposes an external http endpoint", - "default": "Internal", - "enum": [ - "External", - "Internal" - ], - "type": "string", - "x-ms-enum": { - "name": "HttpEndpointEnum", - "modelAsString": true - } + "ingress": { + "$ref": "#/definitions/JavaComponentIngress", + "description": "Java Component Ingress configurations." } }, "x-ms-discriminator-value": "SpringCloudEureka" diff --git a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_CreateOrUpdate.json b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_CreateOrUpdate.json index b2bdb8578c20..b1fc9b0e06cb 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_CreateOrUpdate.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_CreateOrUpdate.json @@ -17,8 +17,7 @@ "propertyName": "spring.boot.admin.monitor.status-interval", "value": "10000ms" } - ], - "httpEndpoint": "External" + ] } } }, @@ -42,8 +41,9 @@ "value": "10000ms" } ], - "httpEndpoint": "External", - "fqdn": "myjavacomponent.myenvironment.test.net" + "ingress": { + "fqdn": "myjavacomponent.myenvironment.test.net" + } } } }, @@ -66,8 +66,9 @@ "value": "10000ms" } ], - "httpEndpoint": "External", - "fqdn": "myjavacomponent.myenvironment.test.net" + "ingress": { + "fqdn": "myjavacomponent.myenvironment.test.net" + } } } } diff --git a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_Get.json b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_Get.json index 2fa7c604009e..8c7fdcf7bf6d 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_Get.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_Get.json @@ -26,8 +26,9 @@ "value": "10000ms" } ], - "httpEndpoint": "External", - "fqdn": "myjavacomponent.myenvironment.test.net" + "ingress": { + "fqdn": "myjavacomponent.myenvironment.test.net" + } } } } diff --git a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_List.json b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_List.json index c26d843137f1..dc255672539b 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_List.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_List.json @@ -26,8 +26,9 @@ "value": "10000ms" } ], - "httpEndpoint": "External", - "fqdn": "myjavacomponent.myenvironment.test.net" + "ingress": { + "fqdn": "myjavacomponent.myenvironment.test.net" + } } }, { @@ -43,8 +44,9 @@ "value": "" } ], - "httpEndpoint": "External", - "fqdn": "myjavacomponent.myenvironment.test.net" + "ingress": { + "fqdn": "myjavacomponent.myenvironment.test.net" + } } } ] diff --git a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_Patch.json b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_Patch.json index de199f1175da..09af6e597e05 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_Patch.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/examples/JavaComponents_Patch.json @@ -17,8 +17,7 @@ "propertyName": "spring.boot.admin.monitor.status-interval", "value": "10000ms" } - ], - "httpEndpoint": "External" + ] } } }, @@ -42,8 +41,9 @@ "value": "10000ms" } ], - "httpEndpoint": "External", - "fqdn": "myjavacomponent.myenvironment.test.net" + "ingress": { + "fqdn": "myjavacomponent.myenvironment.test.net" + } } } }, diff --git a/specification/app/resource-manager/readme.md b/specification/app/resource-manager/readme.md index 5134bccd155b..31a4594942c2 100644 --- a/specification/app/resource-manager/readme.md +++ b/specification/app/resource-manager/readme.md @@ -63,6 +63,11 @@ input-file: - Microsoft.App/preview/2024-02-02-preview/Subscriptions.json - Microsoft.App/preview/2024-02-02-preview/Usages.json - Microsoft.App/preview/2024-02-02-preview/FunctionsExtension.json +directive: + - suppress: PatchBodyParametersSchema + from: JavaComponents.json + reason: | + Java Component is using componentType as the discriminator. While the discriminator is a required property, this rule prevent it being present in the patch request body. ``` ### Tag: package-preview-2023-11 From 9b51b7b15e1a3d68bb8a66d85034eddcd27de470 Mon Sep 17 00:00:00 2001 From: Xuyang Cao Date: Tue, 12 Mar 2024 10:34:48 +0800 Subject: [PATCH 14/14] fix --- .../preview/2024-02-02-preview/JavaComponents.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json index e56a3670b6ab..744d4f2d9b9f 100644 --- a/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json +++ b/specification/app/resource-manager/Microsoft.App/preview/2024-02-02-preview/JavaComponents.json @@ -417,8 +417,8 @@ "enum": [ "SpringBootAdmin", "SpringCloudEureka", - "SpringCloudConfig" - "Nacos", + "SpringCloudConfig", + "Nacos" ], "type": "string", "x-ms-enum": {