Skip to content

Commit 2202a66

Browse files
Option for backward compatible, prepare release 0.36.1 (#3212)
1 parent 232a95c commit 2202a66

File tree

19 files changed

+646
-657
lines changed

19 files changed

+646
-657
lines changed

core

Submodule core updated 94 files

typespec-extension/changelog.md

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

3+
## 0.36.1 (2025-10-23)
4+
5+
Compatible with compiler 1.5.0.
6+
7+
- Supported `float32-as-double` emitter option, default is `true`.
8+
- Supported `uuid-as-string` emitter option, default is `true`.
9+
10+
Both options are for backward compatibility.
11+
312
## 0.36.0 (2025-10-20)
413

514
Compatible with compiler 1.5.0.

typespec-extension/package-lock.json

Lines changed: 509 additions & 623 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: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@azure-tools/typespec-java",
3-
"version": "0.36.0",
3+
"version": "0.36.1",
44
"description": "TypeSpec library for emitting Java client from the TypeSpec REST protocol binding",
55
"keywords": [
66
"TypeSpec"
@@ -70,14 +70,14 @@
7070
"@azure-tools/typespec-azure-core": "0.61.0",
7171
"@azure-tools/typespec-azure-resource-manager": "0.61.0",
7272
"@azure-tools/typespec-azure-rulesets": "0.61.0",
73-
"@azure-tools/typespec-client-generator-core": "0.61.1",
73+
"@azure-tools/typespec-client-generator-core": "0.61.2",
7474
"@azure-tools/typespec-liftr-base": "0.11.0",
75-
"@microsoft/api-extractor": "^7.53.1",
75+
"@microsoft/api-extractor": "^7.53.2",
7676
"@types/js-yaml": "~4.0.9",
7777
"@types/lodash": "~4.17.20",
78-
"@types/node": "~24.8.0",
79-
"@typescript-eslint/eslint-plugin": "~8.46.1",
80-
"@typescript-eslint/parser": "~8.46.1",
78+
"@types/node": "~24.9.1",
79+
"@typescript-eslint/eslint-plugin": "~8.46.2",
80+
"@typescript-eslint/parser": "~8.46.2",
8181
"@typespec/compiler": "1.5.0",
8282
"@typespec/events": "0.75.0",
8383
"@typespec/http": "1.5.0",
@@ -88,22 +88,22 @@
8888
"@typespec/tspd": "0.73.0",
8989
"@typespec/versioning": "0.75.0",
9090
"@typespec/xml": "0.75.0",
91-
"@vitest/coverage-v8": "^3.2.4",
92-
"@vitest/ui": "^3.2.4",
91+
"@vitest/coverage-v8": "^4.0.1",
92+
"@vitest/ui": "^4.0.1",
9393
"c8": "~10.1.3",
94-
"eslint": "~9.37.0",
94+
"eslint": "~9.38.0",
9595
"eslint-plugin-deprecation": "~3.0.0",
9696
"eslint-plugin-import": "^2.32.0",
9797
"eslint-plugin-unicorn": "^61.0.2",
9898
"prettier": "~3.6.2",
9999
"rimraf": "~6.0.1",
100100
"typescript": "~5.9.3",
101-
"typescript-eslint": "^8.46.1",
102-
"vitest": "^3.2.4"
101+
"typescript-eslint": "^8.46.2",
102+
"vitest": "^4.0.1"
103103
},
104104
"overrides": {
105-
"eslint": "~9.37.0",
106-
"@typescript-eslint/eslint-plugin": "~8.46.1",
107-
"@typescript-eslint/parser": "~8.46.1"
105+
"eslint": "~9.38.0",
106+
"@typescript-eslint/eslint-plugin": "~8.46.2",
107+
"@typescript-eslint/parser": "~8.46.2"
108108
}
109109
}

typespec-extension/src/options.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,20 @@ export const EmitterOptionsSchema: JSONSchemaType<EmitterOptions> = {
8585
nullable: true,
8686
default: false,
8787
},
88+
"float32-as-double": {
89+
type: "boolean",
90+
description:
91+
"When set to `true`, the emitter generates Java `double` for TypeSpec `float32`; otherwise, the emitter generates `float`. Default value is `true`. This option is for backward-compatibility.",
92+
nullable: true,
93+
default: true,
94+
},
95+
"uuid-as-string": {
96+
type: "boolean",
97+
description:
98+
"When set to `true`, the emitter generates Java `String` for TypeSpec `Azure.Core.uuid`; otherwise, the emitter generates `UUID`. Default value is `true`. This option is for backward-compatibility.",
99+
nullable: true,
100+
default: true,
101+
},
88102

89103
// customization
90104
...UnbrandedSdkEmitterOptions["generate-protocol-methods"],

typespec-tests/Generate.ps1

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ $generateScript = {
7272
# TODO https://github.com/Azure/autorest.java/issues/2964
7373
# also serve as a test for "use-object-for-unknown" emitter option
7474
$tspOptions += " --option ""@azure-tools/typespec-java.use-object-for-unknown=true"""
75-
} elseif ($tspFile -match "arm.tsp") {
75+
} elseif ($tspFile -match "tsp[\\/]arm.tsp") {
7676
# for mgmt, do not generate tests due to random mock values
7777
$tspOptions += " --option ""@azure-tools/typespec-java.generate-tests=false"""
7878
# test service-name
@@ -87,7 +87,10 @@ $generateScript = {
8787
$tspOptions += " --option ""@azure-tools/typespec-java.remove-inner=NginxConfigurationResponse"""
8888
# generate async methods
8989
$tspOptions += " --option ""@azure-tools/typespec-java.generate-async-methods=true"""
90-
} elseif ($tspFile -match "arm-stream-style-serialization.tsp") {
90+
# backward compatible options
91+
$tspOptions += " --option ""@azure-tools/typespec-java.float32-as-double=false"""
92+
$tspOptions += " --option ""@azure-tools/typespec-java.uuid-as-string=false"""
93+
} elseif ($tspFile -match "tsp[\\/]arm-stream-style-serialization.tsp") {
9194
# for mgmt, do not generate tests due to random mock values
9295
$tspOptions += " --option ""@azure-tools/typespec-java.generate-tests=false"""
9396
# test service-name
@@ -96,12 +99,12 @@ $generateScript = {
9699
$tspOptions += " --option ""@azure-tools/typespec-java.property-include-always=FunctionConfiguration.input"""
97100
# enable client side validations
98101
$tspOptions += " --option ""@azure-tools/typespec-java.client-side-validations=true"""
99-
} elseif ($tspFile -match "arm-customization.tsp") {
102+
} elseif ($tspFile -match "tsp[\\/]arm-customization.tsp") {
100103
# for mgmt, do not generate tests due to random mock values
101104
$tspOptions += " --option ""@azure-tools/typespec-java.generate-tests=false"""
102105
# add customization code
103106
$tspOptions += " --option ""@azure-tools/typespec-java.customization-class=../../customization/src/main/java/KeyVaultCustomization.java"""
104-
} elseif ($tspFile -match "subclient.tsp") {
107+
} elseif ($tspFile -match "tsp[\\/]subclient.tsp") {
105108
$tspOptions += " --option ""@azure-tools/typespec-java.enable-subclient=true"""
106109
# test for include-api-view-properties
107110
$tspOptions += " --option ""@azure-tools/typespec-java.include-api-view-properties=false"""

typespec-tests/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"@typespec/spector": "0.1.0-alpha.19",
1414
"@typespec/http-specs": "0.1.0-alpha.27",
1515
"@azure-tools/azure-http-specs": "0.1.0-alpha.31",
16-
"@azure-tools/typespec-java": "file:/../typespec-extension/azure-tools-typespec-java-0.36.0.tgz"
16+
"@azure-tools/typespec-java": "file:/../typespec-extension/azure-tools-typespec-java-0.36.1.tgz"
1717
},
1818
"devDependencies": {
1919
"@typespec/prettier-plugin-typespec": "^1.5.0",

typespec-tests/src/main/java/tsptest/armresourceprovider/fluent/models/TopLevelArmResourceInner.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,15 @@ public TopLevelArmResourceInner withStartTimeStamp(OffsetDateTime startTimeStamp
219219
return this;
220220
}
221221

222+
/**
223+
* Get the size property: The size property.
224+
*
225+
* @return the size value.
226+
*/
227+
public Float size() {
228+
return this.innerProperties() == null ? null : this.innerProperties().size();
229+
}
230+
222231
/**
223232
* Get the provisioningState property: The status of the last operation.
224233
*

typespec-tests/src/main/java/tsptest/armresourceprovider/fluent/models/TopLevelArmResourceProperties.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ public final class TopLevelArmResourceProperties implements JsonSerializable<Top
4646
*/
4747
private OffsetDateTime startTimeStamp;
4848

49+
/*
50+
* The size property.
51+
*/
52+
private Float size;
53+
4954
/*
5055
* The status of the last operation.
5156
*/
@@ -146,6 +151,15 @@ public TopLevelArmResourceProperties withStartTimeStamp(OffsetDateTime startTime
146151
return this;
147152
}
148153

154+
/**
155+
* Get the size property: The size property.
156+
*
157+
* @return the size value.
158+
*/
159+
public Float size() {
160+
return this.size;
161+
}
162+
149163
/**
150164
* Get the provisioningState property: The status of the last operation.
151165
*
@@ -198,6 +212,8 @@ public static TopLevelArmResourceProperties fromJson(JsonReader jsonReader) thro
198212
} else if ("configurationEndpoints".equals(fieldName)) {
199213
List<String> configurationEndpoints = reader.readArray(reader1 -> reader1.getString());
200214
deserializedTopLevelArmResourceProperties.configurationEndpoints = configurationEndpoints;
215+
} else if ("size".equals(fieldName)) {
216+
deserializedTopLevelArmResourceProperties.size = reader.getNullable(JsonReader::getFloat);
201217
} else if ("provisioningState".equals(fieldName)) {
202218
deserializedTopLevelArmResourceProperties.provisioningState
203219
= ProvisioningState.fromString(reader.getString());

typespec-tests/src/main/java/tsptest/armresourceprovider/implementation/TopLevelArmResourceImpl.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ public OffsetDateTime startTimeStamp() {
7777
return this.innerModel().startTimeStamp();
7878
}
7979

80+
public Float size() {
81+
return this.innerModel().size();
82+
}
83+
8084
public ProvisioningState provisioningState() {
8185
return this.innerModel().provisioningState();
8286
}

0 commit comments

Comments
 (0)