Skip to content

Commit 16bda4a

Browse files
eng, bump typespec libs, prepare 0.27.0 release (#2995)
1 parent 132e859 commit 16bda4a

20 files changed

+415
-371
lines changed

core

Submodule core updated 185 files

typespec-extension/changelog.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Release History
22

3+
## 0.27.0 (2024-12-11)
4+
5+
Compatible with compiler 0.63.
6+
37
## 0.26.1 (2024-12-10)
48

59
Compatible with compiler 0.62.

typespec-extension/package-lock.json

+303-200
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

typespec-extension/package.json

+31-31
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@azure-tools/typespec-java",
3-
"version": "0.26.1",
3+
"version": "0.27.0",
44
"description": "TypeSpec library for emitting Java client from the TypeSpec REST protocol binding",
55
"keywords": [
66
"TypeSpec"
@@ -45,47 +45,47 @@
4545
"generator/http-client-generator/target/emitter.jar"
4646
],
4747
"peerDependencies": {
48-
"@azure-tools/typespec-azure-core": ">=0.48.0 <1.0.0",
49-
"@azure-tools/typespec-azure-resource-manager": ">=0.48.0 <1.0.0",
50-
"@azure-tools/typespec-autorest": ">=0.48.0 <1.0.0",
51-
"@azure-tools/typespec-azure-rulesets": ">=0.48.0 <1.0.0",
52-
"@azure-tools/typespec-client-generator-core": ">=0.48.5 <1.0.0",
53-
"@typespec/compiler": ">=0.62.0 <1.0.0",
54-
"@typespec/http": ">=0.62.0 <1.0.0",
55-
"@typespec/openapi": ">=0.62.0 <1.0.0",
56-
"@typespec/rest": ">=0.62.0 <1.0.0",
57-
"@typespec/versioning": ">=0.62.0 <1.0.0",
58-
"@typespec/xml": ">=0.62.0 <1.0.0"
48+
"@azure-tools/typespec-azure-core": ">=0.49.0 <1.0.0",
49+
"@azure-tools/typespec-azure-resource-manager": ">=0.49.0 <1.0.0",
50+
"@azure-tools/typespec-autorest": ">=0.49.0 <1.0.0",
51+
"@azure-tools/typespec-azure-rulesets": ">=0.49.0 <1.0.0",
52+
"@azure-tools/typespec-client-generator-core": ">=0.49.0 <1.0.0",
53+
"@typespec/compiler": ">=0.63.0 <1.0.0",
54+
"@typespec/http": ">=0.63.0 <1.0.0",
55+
"@typespec/openapi": ">=0.63.0 <1.0.0",
56+
"@typespec/rest": ">=0.63.0 <1.0.0",
57+
"@typespec/versioning": ">=0.63.0 <1.0.0",
58+
"@typespec/xml": ">=0.63.0 <1.0.0"
5959
},
6060
"dependencies": {
6161
"@autorest/codemodel": "~4.20.0",
6262
"js-yaml": "~4.1.0",
6363
"lodash": "~4.17.21"
6464
},
6565
"devDependencies": {
66-
"@azure-tools/typespec-azure-core": "0.48.0",
67-
"@azure-tools/typespec-azure-resource-manager": "0.48.0",
68-
"@azure-tools/typespec-autorest": "0.48.0",
69-
"@azure-tools/typespec-azure-rulesets": "0.48.0",
70-
"@azure-tools/typespec-client-generator-core": "0.48.5",
66+
"@azure-tools/typespec-azure-core": "0.49.0",
67+
"@azure-tools/typespec-azure-resource-manager": "0.49.0",
68+
"@azure-tools/typespec-autorest": "0.49.0",
69+
"@azure-tools/typespec-azure-rulesets": "0.49.0",
70+
"@azure-tools/typespec-client-generator-core": "0.49.0",
7171
"@types/js-yaml": "~4.0.9",
7272
"@types/lodash": "~4.17.13",
73-
"@types/mocha": "~10.0.9",
74-
"@types/node": "~22.9.0",
75-
"@typescript-eslint/eslint-plugin": "~8.14.0",
76-
"@typescript-eslint/parser": "~8.14.0",
77-
"@typespec/compiler": "0.62.0",
78-
"@typespec/http": "0.62.0",
79-
"@typespec/openapi": "0.62.0",
80-
"@typespec/rest": "0.62.0",
81-
"@typespec/versioning": "0.62.0",
82-
"@typespec/xml": "0.62.0",
83-
"c8": "~10.1.2",
73+
"@types/mocha": "~10.0.10",
74+
"@types/node": "~22.10.1",
75+
"@typescript-eslint/eslint-plugin": "~8.18.0",
76+
"@typescript-eslint/parser": "~8.18.0",
77+
"@typespec/compiler": "0.63.0",
78+
"@typespec/http": "0.63.0",
79+
"@typespec/openapi": "0.63.0",
80+
"@typespec/rest": "0.63.0",
81+
"@typespec/versioning": "0.63.0",
82+
"@typespec/xml": "0.63.0",
83+
"c8": "~10.1.3",
8484
"eslint": "~8.57.0",
8585
"eslint-plugin-deprecation": "~3.0.0",
86-
"mocha": "~10.8.2",
87-
"prettier": "~3.3.3",
86+
"mocha": "~11.0.1",
87+
"prettier": "~3.4.2",
8888
"rimraf": "~6.0.1",
89-
"typescript": "~5.6.3"
89+
"typescript": "~5.7.2"
9090
}
9191
}

typespec-extension/readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Install [Java](https://docs.microsoft.com/java/openjdk/download) 11 or above. (V
66

77
Install [Maven](https://maven.apache.org/install.html). (Verify by running `mvn --version`)
88

9-
Install [TypeSpec](https://typespec.io/) 0.62.
9+
Install [TypeSpec](https://typespec.io/) 0.63.
1010

1111
# Initialize TypeSpec Project
1212

typespec-tests/package.json

+14-14
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,25 @@
99
"testserver-run": "npx cadl-ranch serve ./node_modules/@azure-tools/cadl-ranch-specs/http --coverageFile ./cadl-ranch-coverage-java.json"
1010
},
1111
"dependencies": {
12-
"@azure-tools/cadl-ranch-specs": "0.39.4",
13-
"@azure-tools/typespec-java": "file:/../typespec-extension/azure-tools-typespec-java-0.26.1.tgz"
12+
"@azure-tools/cadl-ranch-specs": "0.39.5",
13+
"@azure-tools/typespec-java": "file:/../typespec-extension/azure-tools-typespec-java-0.27.0.tgz"
1414
},
1515
"devDependencies": {
16-
"@typespec/prettier-plugin-typespec": "~0.62.0",
16+
"@typespec/prettier-plugin-typespec": "~0.63.0",
1717
"prettier-plugin-organize-imports": "4.1.0",
18-
"prettier": "~3.3.3"
18+
"prettier": "~3.4.2"
1919
},
2020
"overrides": {
21-
"@typespec/compiler": "~0.62.0",
22-
"@typespec/http": "~0.62.0",
23-
"@typespec/rest": "~0.62.0",
24-
"@typespec/versioning": "~0.62.0",
25-
"@typespec/openapi": "~0.62.0",
26-
"@typespec/xml": "~0.62.0",
27-
"@azure-tools/typespec-azure-core": "~0.48.0",
28-
"@azure-tools/typespec-client-generator-core": "~0.48.0",
29-
"@azure-tools/typespec-azure-resource-manager": "~0.48.0",
30-
"@azure-tools/typespec-autorest": "~0.48.0"
21+
"@typespec/compiler": "~0.63.0",
22+
"@typespec/http": "~0.63.0",
23+
"@typespec/rest": "~0.63.0",
24+
"@typespec/versioning": "~0.63.0",
25+
"@typespec/openapi": "~0.63.0",
26+
"@typespec/xml": "~0.63.0",
27+
"@azure-tools/typespec-azure-core": "~0.49.0",
28+
"@azure-tools/typespec-client-generator-core": "~0.49.0",
29+
"@azure-tools/typespec-azure-resource-manager": "~0.49.0",
30+
"@azure-tools/typespec-autorest": "~0.49.0"
3131
},
3232
"private": true
3333
}

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public final class OperationInner {
3232
/*
3333
* Localized display information for this particular operation.
3434
*/
35-
@JsonProperty(value = "display", access = JsonProperty.Access.WRITE_ONLY)
35+
@JsonProperty(value = "display")
3636
private OperationDisplay display;
3737

3838
/*
@@ -45,7 +45,7 @@ public final class OperationInner {
4545
/*
4646
* Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
4747
*/
48-
@JsonProperty(value = "actionType")
48+
@JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY)
4949
private ActionType actionType;
5050

5151
/**

typespec-tests/src/main/java/tsptest/response/implementation/ResponseClientImpl.java

+4-88
Original file line numberDiff line numberDiff line change
@@ -407,26 +407,6 @@ Mono<Response<BinaryData>> listStringsNext(@PathParam(value = "nextLink", encode
407407
Response<BinaryData> listStringsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink,
408408
@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
409409
Context context);
410-
411-
@Get("{nextLink}")
412-
@ExpectedResponses({ 200 })
413-
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
414-
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
415-
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
416-
@UnexpectedResponseExceptionType(HttpResponseException.class)
417-
Mono<Response<BinaryData>> listIntegersNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
418-
@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
419-
Context context);
420-
421-
@Get("{nextLink}")
422-
@ExpectedResponses({ 200 })
423-
@UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
424-
@UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
425-
@UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
426-
@UnexpectedResponseExceptionType(HttpResponseException.class)
427-
Response<BinaryData> listIntegersNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink,
428-
@HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions,
429-
Context context);
430410
}
431411

432412
/**
@@ -1290,7 +1270,7 @@ private Mono<PagedResponse<BinaryData>> listIntegersSinglePageAsync(RequestOptio
12901270
return FluxUtil
12911271
.withContext(context -> service.listIntegers(this.getEndpoint(), accept, requestOptions, context))
12921272
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
1293-
getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null));
1273+
getValues(res.getValue(), "value"), null, null));
12941274
}
12951275

12961276
/**
@@ -1312,11 +1292,7 @@ private Mono<PagedResponse<BinaryData>> listIntegersSinglePageAsync(RequestOptio
13121292
*/
13131293
@ServiceMethod(returns = ReturnType.COLLECTION)
13141294
public PagedFlux<BinaryData> listIntegersAsync(RequestOptions requestOptions) {
1315-
RequestOptions requestOptionsForNextPage = new RequestOptions();
1316-
requestOptionsForNextPage.setContext(
1317-
requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE);
1318-
return new PagedFlux<>(() -> listIntegersSinglePageAsync(requestOptions),
1319-
nextLink -> listIntegersNextSinglePageAsync(nextLink, requestOptionsForNextPage));
1295+
return new PagedFlux<>(() -> listIntegersSinglePageAsync(requestOptions));
13201296
}
13211297

13221298
/**
@@ -1341,7 +1317,7 @@ private PagedResponse<BinaryData> listIntegersSinglePage(RequestOptions requestO
13411317
final String accept = "application/json";
13421318
Response<BinaryData> res = service.listIntegersSync(this.getEndpoint(), accept, requestOptions, Context.NONE);
13431319
return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
1344-
getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null);
1320+
getValues(res.getValue(), "value"), null, null);
13451321
}
13461322

13471323
/**
@@ -1363,11 +1339,7 @@ private PagedResponse<BinaryData> listIntegersSinglePage(RequestOptions requestO
13631339
*/
13641340
@ServiceMethod(returns = ReturnType.COLLECTION)
13651341
public PagedIterable<BinaryData> listIntegers(RequestOptions requestOptions) {
1366-
RequestOptions requestOptionsForNextPage = new RequestOptions();
1367-
requestOptionsForNextPage.setContext(
1368-
requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE);
1369-
return new PagedIterable<>(() -> listIntegersSinglePage(requestOptions),
1370-
nextLink -> listIntegersNextSinglePage(nextLink, requestOptionsForNextPage));
1342+
return new PagedIterable<>(() -> listIntegersSinglePage(requestOptions));
13711343
}
13721344

13731345
/**
@@ -1540,62 +1512,6 @@ private PagedResponse<BinaryData> listStringsNextSinglePage(String nextLink, Req
15401512
getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null);
15411513
}
15421514

1543-
/**
1544-
* Get the next page of items.
1545-
* <p><strong>Response Body Schema</strong></p>
1546-
*
1547-
* <pre>
1548-
* {@code
1549-
* int
1550-
* }
1551-
* </pre>
1552-
*
1553-
* @param nextLink The URL to get the next list of items.
1554-
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
1555-
* @throws HttpResponseException thrown if the request is rejected by server.
1556-
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
1557-
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
1558-
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
1559-
* @return the response body along with {@link PagedResponse} on successful completion of {@link Mono}.
1560-
*/
1561-
@ServiceMethod(returns = ReturnType.SINGLE)
1562-
private Mono<PagedResponse<BinaryData>> listIntegersNextSinglePageAsync(String nextLink,
1563-
RequestOptions requestOptions) {
1564-
final String accept = "application/json";
1565-
return FluxUtil
1566-
.withContext(
1567-
context -> service.listIntegersNext(nextLink, this.getEndpoint(), accept, requestOptions, context))
1568-
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
1569-
getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null));
1570-
}
1571-
1572-
/**
1573-
* Get the next page of items.
1574-
* <p><strong>Response Body Schema</strong></p>
1575-
*
1576-
* <pre>
1577-
* {@code
1578-
* int
1579-
* }
1580-
* </pre>
1581-
*
1582-
* @param nextLink The URL to get the next list of items.
1583-
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
1584-
* @throws HttpResponseException thrown if the request is rejected by server.
1585-
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
1586-
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
1587-
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
1588-
* @return the response body along with {@link PagedResponse}.
1589-
*/
1590-
@ServiceMethod(returns = ReturnType.SINGLE)
1591-
private PagedResponse<BinaryData> listIntegersNextSinglePage(String nextLink, RequestOptions requestOptions) {
1592-
final String accept = "application/json";
1593-
Response<BinaryData> res
1594-
= service.listIntegersNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE);
1595-
return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
1596-
getValues(res.getValue(), "value"), getNextLink(res.getValue(), "nextLink"), null);
1597-
}
1598-
15991515
private List<BinaryData> getValues(BinaryData binaryData, String path) {
16001516
try {
16011517
Map<?, ?> obj = binaryData.toObject(Map.class);

typespec-tests/src/main/java/tsptest/visibility/VisibilityAsyncClient.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ public Mono<Response<BinaryData>> getWithResponse(RequestOptions requestOptions)
7575
* <pre>
7676
* {@code
7777
* {
78+
* secretName: String (Required)
7879
* name: String (Required)
7980
* }
8081
* }
@@ -113,7 +114,7 @@ public Mono<Response<BinaryData>> createWithResponse(BinaryData dog, RequestOpti
113114
* <pre>
114115
* {@code
115116
* {
116-
* id: int (Required)
117+
* secretName: String (Required)
117118
* name: String (Required)
118119
* }
119120
* }
@@ -125,7 +126,6 @@ public Mono<Response<BinaryData>> createWithResponse(BinaryData dog, RequestOpti
125126
* {@code
126127
* {
127128
* id: int (Required)
128-
* secretName: String (Required)
129129
* name: String (Required)
130130
* }
131131
* }
@@ -237,11 +237,11 @@ public Mono<Dog> create(WriteDog dog) {
237237
*/
238238
@Generated
239239
@ServiceMethod(returns = ReturnType.SINGLE)
240-
public Mono<Dog> query(ReadDog dog) {
240+
public Mono<ReadDog> query(WriteDog dog) {
241241
// Generated convenience method for queryWithResponse
242242
RequestOptions requestOptions = new RequestOptions();
243243
return queryWithResponse(BinaryData.fromObject(dog), requestOptions).flatMap(FluxUtil::toMono)
244-
.map(protocolMethodData -> protocolMethodData.toObject(Dog.class));
244+
.map(protocolMethodData -> protocolMethodData.toObject(ReadDog.class));
245245
}
246246

247247
/**

typespec-tests/src/main/java/tsptest/visibility/VisibilityClient.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public Response<BinaryData> getWithResponse(RequestOptions requestOptions) {
7373
* <pre>
7474
* {@code
7575
* {
76+
* secretName: String (Required)
7677
* name: String (Required)
7778
* }
7879
* }
@@ -111,7 +112,7 @@ public Response<BinaryData> createWithResponse(BinaryData dog, RequestOptions re
111112
* <pre>
112113
* {@code
113114
* {
114-
* id: int (Required)
115+
* secretName: String (Required)
115116
* name: String (Required)
116117
* }
117118
* }
@@ -123,7 +124,6 @@ public Response<BinaryData> createWithResponse(BinaryData dog, RequestOptions re
123124
* {@code
124125
* {
125126
* id: int (Required)
126-
* secretName: String (Required)
127127
* name: String (Required)
128128
* }
129129
* }
@@ -233,10 +233,10 @@ public Dog create(WriteDog dog) {
233233
*/
234234
@Generated
235235
@ServiceMethod(returns = ReturnType.SINGLE)
236-
public Dog query(ReadDog dog) {
236+
public ReadDog query(WriteDog dog) {
237237
// Generated convenience method for queryWithResponse
238238
RequestOptions requestOptions = new RequestOptions();
239-
return queryWithResponse(BinaryData.fromObject(dog), requestOptions).getValue().toObject(Dog.class);
239+
return queryWithResponse(BinaryData.fromObject(dog), requestOptions).getValue().toObject(ReadDog.class);
240240
}
241241

242242
/**

typespec-tests/src/main/java/tsptest/visibility/VisibilityWriteAsyncClient.java

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public final class VisibilityWriteAsyncClient {
4646
* <pre>
4747
* {@code
4848
* {
49+
* secretName: String (Required)
4950
* name: String (Required)
5051
* }
5152
* }

typespec-tests/src/main/java/tsptest/visibility/VisibilityWriteClient.java

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public final class VisibilityWriteClient {
4444
* <pre>
4545
* {@code
4646
* {
47+
* secretName: String (Required)
4748
* name: String (Required)
4849
* }
4950
* }

0 commit comments

Comments
 (0)