Skip to content

Commit 697d60b

Browse files
prepare release for typespec.java/0.30.1 and autorest.java/4.1.47 (#3109)
* sync core * sync main core core * test for non-null writeUntypedField * sync tests * enable sync-stack by default * premium still async * update autorest.java * update typespec.java * re-generate test code * sync main * enable-sync-stack for non-premium --------- Co-authored-by: actions-user <[email protected]>
1 parent fe757d6 commit 697d60b

File tree

31 files changed

+2573
-1960
lines changed

31 files changed

+2573
-1960
lines changed

azure-dataplane-tests/src/main/java/com/azure/containers/containerregistry/implementation/models/AcrErrorInfo.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
117117
jsonWriter.writeStartObject();
118118
jsonWriter.writeStringField("code", this.code);
119119
jsonWriter.writeStringField("message", this.message);
120-
jsonWriter.writeUntypedField("detail", this.detail);
120+
if (this.detail != null) {
121+
jsonWriter.writeUntypedField("detail", this.detail);
122+
}
121123
return jsonWriter.writeEndObject();
122124
}
123125

core

Submodule core updated 192 files

fluent-tests/Initialize-Tests.ps1

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -75,26 +75,26 @@ SUCCEEDED
7575

7676
$job = @(
7777
# fluent premium
78-
"--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS --input-file=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/resources/resource-manager/Microsoft.Resources/stable/2019-08-01/resources.json --namespace=com.azure.mgmttest.resources",
79-
"--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS ./swagger/readme.storage.md --namespace=com.azure.mgmttest.storage",
80-
"--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS ./swagger/readme.network.md --namespace=com.azure.mgmttest.network",
78+
"--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS --input-file=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/resources/resource-manager/Microsoft.Resources/stable/2019-08-01/resources.json --namespace=com.azure.mgmttest.resources --enable-sync-stack=false",
79+
"--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS ./swagger/readme.storage.md --namespace=com.azure.mgmttest.storage --enable-sync-stack=false",
80+
"--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS ./swagger/readme.network.md --namespace=com.azure.mgmttest.network --enable-sync-stack=false",
8181

8282
# error response that is subclass of ManagementException
83-
"--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS ./swagger/readme.appservice.md --namespace=com.azure.mgmttest.appservice",
83+
"--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS ./swagger/readme.appservice.md --namespace=com.azure.mgmttest.appservice --enable-sync-stack=false",
8484

8585
# multiple inheritance
86-
"--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",
86+
"--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 --enable-sync-stack=false",
8787

8888
# flatten payload
89-
"--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS --input-file=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2021-03-01/cloudService.json --namespace=com.azure.mgmttest.compute",
89+
"--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS --input-file=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/compute/resource-manager/Microsoft.Compute/CloudserviceRP/stable/2021-03-01/cloudService.json --namespace=com.azure.mgmttest.compute --enable-sync-stack=false",
9090

9191
# error response that not conform to ARM
92-
"--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS --input-file=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/graphrbac/data-plane/Microsoft.GraphRbac/stable/1.6/graphrbac.json --namespace=com.azure.mgmttest.authorization",
92+
"--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS --input-file=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/graphrbac/data-plane/Microsoft.GraphRbac/stable/1.6/graphrbac.json --namespace=com.azure.mgmttest.authorization --enable-sync-stack=false",
9393

9494
# client model flatten at autorest.java
95-
"--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS --input-file=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2020-09-30/sharedGallery.json --namespace=com.azure.mgmttest.computegallery",
96-
"--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS --input-file=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/network/resource-manager/Microsoft.Network/stable/2021-02-01/networkWatcher.json --namespace=com.azure.mgmttest.networkwatcher",
97-
"--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",
95+
"--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS --input-file=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/compute/resource-manager/Microsoft.Compute/GalleryRP/stable/2020-09-30/sharedGallery.json --namespace=com.azure.mgmttest.computegallery --enable-sync-stack=false",
96+
"--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS --input-file=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/network/resource-manager/Microsoft.Network/stable/2021-02-01/networkWatcher.json --namespace=com.azure.mgmttest.networkwatcher --enable-sync-stack=false",
97+
"--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 --enable-sync-stack=false",
9898

9999
# nested x-ms-flatten from superclass in ExtendedProduct
100100
"--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",
@@ -105,20 +105,20 @@ $job = @(
105105
# do not flatten if polymorphic in DevicePropertiesFormat
106106
"--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",
107107
# flatten the empty model which has non-empty parent model
108-
"--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS --input-file=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/dataCollectionRules_API.json --namespace=com.azure.mgmttest.monitor --stream-style-serialization=false",
108+
"--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS --input-file=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-09-01-preview/dataCollectionRules_API.json --namespace=com.azure.mgmttest.monitor --stream-style-serialization=false --enable-sync-stack=false",
109109

110110
# extract systemData from Resource
111111
"--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",
112112
# swagger customized Resource and ProxyResource
113-
"--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS --input-file=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/trafficmanager.json --namespace=com.azure.mgmttest.trafficmanager",
113+
"--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS --input-file=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/trafficmanager/resource-manager/Microsoft.Network/stable/2018-08-01/trafficmanager.json --namespace=com.azure.mgmttest.trafficmanager --enable-sync-stack=false",
114114

115115
# ErrorDetails shared in exception and output
116116
"--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS --input-file=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/8fa9b5051129dd4808c9be1f5b753af226b044db/specification/iothub/resource-manager/Microsoft.Devices/stable/2023-06-30/iothub.json --namespace=com.azure.mgmttest.iothub",
117117

118118
# resource with writable name
119-
"--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS --input-file=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/2548fe40102c9b5aa27a75a126c8367f55cb9e7d/specification/sql/resource-manager/Microsoft.Sql/stable/2021-11-01/FirewallRules.json --java.namespace=com.azure.mgmttest.resourcewithwritablename"
119+
"--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS --input-file=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/2548fe40102c9b5aa27a75a126c8367f55cb9e7d/specification/sql/resource-manager/Microsoft.Sql/stable/2021-11-01/FirewallRules.json --java.namespace=com.azure.mgmttest.resourcewithwritablename --enable-sync-stack=false"
120120
# non-string expandable enum
121-
"--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS --regenerate-pom=false --input-file=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/926540515b9d8059904f023d38c45dda8ba87c9f/specification/monitor/resource-manager/Microsoft.Insights/stable/2023-12-01/scheduledQueryRule_API.json --java.namespace=com.azure.mgmttest.nonstringexpandableenum"
121+
"--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS --regenerate-pom=false --input-file=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/926540515b9d8059904f023d38c45dda8ba87c9f/specification/monitor/resource-manager/Microsoft.Insights/stable/2023-12-01/scheduledQueryRule_API.json --java.namespace=com.azure.mgmttest.nonstringexpandableenum --enable-sync-stack=false"
122122

123123
# fluent lite
124124
"--version=$AUTOREST_CORE_VERSION $FLUENTLITE_ARGUMENTS --pom-file=pom_generated_resources.xml https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/resources/resource-manager/readme.md --tag=package-resources-2021-01 --java.namespace=com.azure.mgmtlitetest.resources",
@@ -155,8 +155,6 @@ $job = @(
155155
"--version=$AUTOREST_CORE_VERSION $FLUENTLITE_ARGUMENTS --regenerate-pom=false --input-file=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/f840c84013f12b701aac7065ceeb13a59b26051b/specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2022-02-05/iotdps.json --java.namespace=com.azure.mgmtlitetest.emptybytearrayinclients"
156156

157157
# sync-stack
158-
# lite
159-
"--version=$AUTOREST_CORE_VERSION $FLUENTLITE_ARGUMENTS --regenerate-pom=false https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/mediaservices/resource-manager/readme.md --tag=package-account-2023-01 --java.namespace=com.azure.mgmtlitetest.mediaservicessync --enable-sync-stack=true"
160158
# premium
161159
"--version=$AUTOREST_CORE_VERSION $FLUENT_ARGUMENTS --input-file=https://raw.githubusercontent.com/Azure/azure-rest-api-specs/8fa9b5051129dd4808c9be1f5b753af226b044db/specification/iothub/resource-manager/Microsoft.Devices/stable/2023-06-30/iothub.json --namespace=com.azure.mgmttest.iothubsync --enable-sync-stack=true"
162160
# special cases

fluent-tests/src/test/java/com/azure/mgmttest/RuntimeTests.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
import com.azure.core.util.serializer.SerializerAdapter;
2525
import com.azure.core.util.serializer.SerializerEncoding;
2626
import com.azure.identity.EnvironmentCredentialBuilder;
27+
import com.azure.json.JsonProviders;
28+
import com.azure.json.JsonWriter;
2729
import com.azure.mgmtlitetest.advisor.AdvisorManager;
2830
import com.azure.mgmtlitetest.advisor.models.ResourceRecommendationBase;
2931
import com.azure.mgmtlitetest.advisor.models.SuppressionContract;
@@ -34,6 +36,7 @@
3436
import com.azure.mgmtlitetest.mediaservices.models.MediaService;
3537
import com.azure.mgmtlitetest.mediaservices.models.StorageAccountType;
3638
import com.azure.mgmtlitetest.resources.ResourceManager;
39+
import com.azure.mgmtlitetest.resources.fluent.models.GenericResourceInner;
3740
import com.azure.mgmtlitetest.resources.models.ResourceGroup;
3841
import com.azure.mgmtlitetest.storage.StorageManager;
3942
import com.azure.mgmtlitetest.storage.models.AccessTier;
@@ -73,6 +76,7 @@
7376
import javax.xml.parsers.ParserConfigurationException;
7477
import java.io.File;
7578
import java.io.IOException;
79+
import java.io.StringWriter;
7680
import java.lang.reflect.Method;
7781
import java.lang.reflect.Modifier;
7882
import java.nio.file.Files;
@@ -499,4 +503,14 @@ public void testStreamStyleSerialization() throws IOException {
499503
Assertions.assertEquals("myDisclaimer", galleryInner.disclaimer());
500504
Assertions.assertEquals("abc", pirCommunityGalleryResource.uniqueId());
501505
}
506+
507+
@Test
508+
public void testWriteUntypedNull() throws IOException {
509+
StringWriter stringWriter = new StringWriter();
510+
try (JsonWriter writer = JsonProviders.createWriter(stringWriter)) {
511+
GenericResourceInner resourceInner = new GenericResourceInner();
512+
resourceInner.toJson(writer);
513+
}
514+
Assertions.assertFalse(stringWriter.toString().contains("properties"));
515+
}
502516
}

fluentgen/readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,5 @@ null-byte-array-maps-to-empty-array: true
7878
graal-vm-config: true
7979
stream-style-serialization: true
8080
use-object-for-unknown: true
81+
enable-sync-stack: true
8182
```

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@autorest/java",
3-
"version": "4.1.46",
3+
"version": "4.1.47",
44
"description": "The Java extension for classic generators in AutoRest.",
55
"scripts": {
66
"autorest": "autorest",

typespec-extension/changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Release History
22

3+
## 0.30.1 (2025-05-08)
4+
5+
Compatible with compiler 1.0.0.
6+
7+
- `enable-sync-stack: true` for MPG by default.
8+
39
## 0.30.0 (2025-05-07)
410

511
Compatible with compiler 1.0.0.

typespec-extension/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

typespec-extension/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@azure-tools/typespec-java",
3-
"version": "0.30.0",
3+
"version": "0.30.1",
44
"description": "TypeSpec library for emitting Java client from the TypeSpec REST protocol binding",
55
"keywords": [
66
"TypeSpec"

0 commit comments

Comments
 (0)