From 6627e64eea35b25163422971b07bb3d372d46b52 Mon Sep 17 00:00:00 2001 From: Xiaofei Cao <92354331+XiaofeiCao@users.noreply.github.com> Date: Wed, 19 Jun 2024 13:37:02 +0800 Subject: [PATCH] enable stream-style for mgmt, prepare release 4.1.31 (#2824) * enable stream-style-serialization for mgmt * bump version * disable stream-style for some RPs * address comments --- fluent-tests/Initialize-Tests.ps1 | 6 +++--- .../src/test/java/com/azure/mgmttest/RuntimeTests.java | 1 + fluentgen/readme.md | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/fluent-tests/Initialize-Tests.ps1 b/fluent-tests/Initialize-Tests.ps1 index 430171683e..b88664db0b 100644 --- a/fluent-tests/Initialize-Tests.ps1 +++ b/fluent-tests/Initialize-Tests.ps1 @@ -74,7 +74,7 @@ $job = @( "--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS ./swagger/readme.network.md --namespace=com.azure.mgmttest.network", # error response that is subclass of ManagementException - "--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS ./swagger/readme.appservice.md --namespace=com.azure.mgmttest.appservice", + "--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS ./swagger/readme.appservice.md --namespace=com.azure.mgmttest.appservice --stream-style-serialization=false", # multiple inheritance "--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS --input-file=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2019-12-12/cosmos-db.json --namespace=com.azure.mgmttest.cosmos", @@ -91,7 +91,7 @@ $job = @( "--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS --input-file=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/cdn/resource-manager/Microsoft.Cdn/stable/2020-09-01/afdx.json --namespace=com.azure.mgmttest.afdx", # nested x-ms-flatten from superclass in ExtendedProduct - "--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS --input-file=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/azurestack/resource-manager/Microsoft.AzureStack/preview/2020-06-01-preview/Product.json --namespace=com.azure.mgmttest.azurestack", + "--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS --input-file=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/azurestack/resource-manager/Microsoft.AzureStack/preview/2020-06-01-preview/Product.json --namespace=com.azure.mgmttest.azurestack --stream-style-serialization=false", # conflict property name from 2 x-ms-flatten in LabDetails and LabProperties "--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS --input-file=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/education/resource-manager/Microsoft.Education/preview/2021-12-01-preview/education.json --namespace=com.azure.mgmttest.education", @@ -100,7 +100,7 @@ $job = @( "--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS --input-file=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/hybridnetwork/resource-manager/Microsoft.HybridNetwork/stable/2021-05-01/device.json --namespace=com.azure.mgmttest.hybridnetwork", # flatten the empty model which has non-empty parent model - "--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS --input-file=https://github.com/Azure/azure-rest-api-specs/blob/main/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/dataCollectionRules_API.json --namespace=com.azure.mgmttest.monitor", + "--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS --input-file=https://github.com/Azure/azure-rest-api-specs/blob/main/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/dataCollectionRules_API.json --namespace=com.azure.mgmttest.monitor --stream-style-serialization=false", # extract systemData from Resource "--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS --input-file=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/29f3116d3ce31f2125d1e2cfb92d6511fcb01c41/specification/postgresqlhsc/resource-manager/Microsoft.DBforPostgreSQL/stable/2022-11-08/postgresqlhsc.json --java.namespace=com.azure.mgmttest.postgresqlhsc", diff --git a/fluent-tests/src/test/java/com/azure/mgmttest/RuntimeTests.java b/fluent-tests/src/test/java/com/azure/mgmttest/RuntimeTests.java index e0fde5f302..3d371d17c7 100644 --- a/fluent-tests/src/test/java/com/azure/mgmttest/RuntimeTests.java +++ b/fluent-tests/src/test/java/com/azure/mgmttest/RuntimeTests.java @@ -126,6 +126,7 @@ public void testWebException() throws IOException { Assertions.assertNotNull(webError.getDetails()); Assertions.assertEquals(1, webError.getDetails().size()); Assertions.assertEquals("InnerError", webError.getDetails().get(0).getCode()); + Assertions.assertEquals("Deployment error.", webError.getInnererror()); GraphErrorException graphException = new GraphErrorException("mock graph error", null); Assertions.assertFalse((Object) graphException instanceof ManagementException); diff --git a/fluentgen/readme.md b/fluentgen/readme.md index 6cafca0676..c88c494650 100755 --- a/fluentgen/readme.md +++ b/fluentgen/readme.md @@ -76,5 +76,5 @@ required-parameter-client-methods: true client-flattened-annotation-target: none null-byte-array-maps-to-empty-array: true graal-vm-config: true -stream-style-serialization: false +stream-style-serialization: true ``` diff --git a/package-lock.json b/package-lock.json index a5f4c06c6b..9352f86650 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@autorest/java", - "version": "4.1.29", + "version": "4.1.31", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@autorest/java", - "version": "4.1.29", + "version": "4.1.31", "license": "MIT", "devDependencies": { "@microsoft.azure/autorest.testserver": "3.3.49", diff --git a/package.json b/package.json index f2aa709b90..70081ee169 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@autorest/java", - "version": "4.1.30", + "version": "4.1.31", "description": "The Java extension for classic generators in AutoRest.", "scripts": { "autorest": "autorest",