Skip to content

Commit 682e34f

Browse files
http-client-java: update Node.js dependencies to latest (#10006)
downstream - Azure/autorest.java#3303 - Azure/azure-sdk-for-java#48398 changes look fine, and mostly in impl --- Bumps Node.js dependencies for `@typespec/http-client-java` to latest available versions. ## Dependency updates - `@azure-tools/typespec-client-generator-core`: `0.66.1` → `0.66.2` (devDependency, peerDependency, and overrides in test packages) - `@azure-tools/typespec-azure-rulesets`: `0.65.1` → `0.66.0` (devDependency) - `@typespec/http-specs`: `0.1.0-alpha.33` → `0.1.0-alpha.34` (both test packages) ## Regenerated code The `http-specs` update introduced a new `ExtensibleString` type in the `specialwords` spec. Regenerated both `http-client-generator-test` and `http-client-generator-clientcore-test` to reflect the new generated Java classes and updated client implementations. ## Tests Added `ExtensibleStringsClientTest` e2e test covering the `putExtensibleStringValue` scenario: sends `ExtensibleString.CLASS` and asserts the same value is returned, as defined in the http-specs scenario. <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: weidongxu-microsoft <53292327+weidongxu-microsoft@users.noreply.github.com>
1 parent 69c4c37 commit 682e34f

File tree

22 files changed

+831
-152
lines changed

22 files changed

+831
-152
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
changeKind: dependencies
3+
packages:
4+
- "@typespec/http-client-java"
5+
---
6+
7+
Update dependencies: `@azure-tools/typespec-client-generator-core` 0.66.1→0.66.2, `@azure-tools/typespec-azure-rulesets` 0.65.1→0.66.0, `@typespec/http-specs` 0.1.0-alpha.33→0.1.0-alpha.34

packages/http-client-java/generator/http-client-generator-clientcore-test/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"dependencies": {
1515
"@typespec/spector": "0.1.0-alpha.24",
1616
"@typespec/spec-api": "0.1.0-alpha.13",
17-
"@typespec/http-specs": "0.1.0-alpha.33",
17+
"@typespec/http-specs": "0.1.0-alpha.34",
1818
"@typespec/json-schema": "1.10.0",
1919
"@typespec/http-client-java": "file:../../typespec-http-client-java-0.7.0.tgz",
2020
"@typespec/http-client-java-tests": "file:"
@@ -30,7 +30,7 @@
3030
"@typespec/sse": "0.80.0",
3131
"@typespec/streams": "0.80.0",
3232
"@azure-tools/typespec-azure-core": "0.66.0",
33-
"@azure-tools/typespec-client-generator-core": "0.66.1",
33+
"@azure-tools/typespec-client-generator-core": "0.66.2",
3434
"@azure-tools/typespec-azure-resource-manager": "0.66.0",
3535
"@azure-tools/typespec-autorest": "0.66.0"
3636
},

packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/specialwords/ExtensibleStringsClient.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import io.clientcore.core.http.models.RequestContext;
1010
import io.clientcore.core.http.models.Response;
1111
import io.clientcore.core.instrumentation.Instrumentation;
12+
import specialwords.extensiblestrings.ExtensibleString;
1213
import specialwords.implementation.ExtensibleStringsImpl;
1314

1415
/**
@@ -36,36 +37,35 @@ public final class ExtensibleStringsClient {
3637
/**
3738
* The putExtensibleStringValue operation.
3839
*
39-
* @param accept The accept parameter.
4040
* @param body The body parameter.
4141
* @param requestContext The context to configure the HTTP request before HTTP client sends it.
4242
* @throws IllegalArgumentException thrown if parameters fail the validation.
4343
* @throws HttpResponseException thrown if the service returns an error.
4444
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
45-
* @return the response body along with {@link Response}.
45+
* @return verify enum member names that are special words using extensible enum (union) along with
46+
* {@link Response}.
4647
*/
4748
@Metadata(properties = { MetadataProperties.GENERATED })
4849
@ServiceMethod(returns = ReturnType.SINGLE)
49-
public Response<String> putExtensibleStringValueWithResponse(String accept, String body,
50+
public Response<ExtensibleString> putExtensibleStringValueWithResponse(ExtensibleString body,
5051
RequestContext requestContext) {
5152
return this.instrumentation.instrumentWithResponse("SpecialWords.ExtensibleStrings.putExtensibleStringValue",
5253
requestContext,
53-
updatedContext -> this.serviceClient.putExtensibleStringValueWithResponse(accept, body, updatedContext));
54+
updatedContext -> this.serviceClient.putExtensibleStringValueWithResponse(body, updatedContext));
5455
}
5556

5657
/**
5758
* The putExtensibleStringValue operation.
5859
*
59-
* @param accept The accept parameter.
6060
* @param body The body parameter.
6161
* @throws IllegalArgumentException thrown if parameters fail the validation.
6262
* @throws HttpResponseException thrown if the service returns an error.
6363
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
64-
* @return the response.
64+
* @return verify enum member names that are special words using extensible enum (union).
6565
*/
6666
@Metadata(properties = { MetadataProperties.GENERATED })
6767
@ServiceMethod(returns = ReturnType.SINGLE)
68-
public String putExtensibleStringValue(String accept, String body) {
69-
return putExtensibleStringValueWithResponse(accept, body, RequestContext.none()).getValue();
68+
public ExtensibleString putExtensibleStringValue(ExtensibleString body) {
69+
return putExtensibleStringValueWithResponse(body, RequestContext.none()).getValue();
7070
}
7171
}

packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/specialwords/SpecialWordsClientBuilder.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@
3535
serviceClients = {
3636
ModelsClient.class,
3737
ModelPropertiesClient.class,
38+
ExtensibleStringsClient.class,
3839
OperationsClient.class,
39-
ParametersClient.class,
40-
ExtensibleStringsClient.class })
40+
ParametersClient.class })
4141
public final class SpecialWordsClientBuilder
4242
implements HttpTrait<SpecialWordsClientBuilder>, ProxyTrait<SpecialWordsClientBuilder>,
4343
ConfigurationTrait<SpecialWordsClientBuilder>, EndpointTrait<SpecialWordsClientBuilder> {
@@ -252,6 +252,17 @@ public ModelPropertiesClient buildModelPropertiesClient() {
252252
return new ModelPropertiesClient(innerClient.getModelProperties(), innerClient.getInstrumentation());
253253
}
254254

255+
/**
256+
* Builds an instance of ExtensibleStringsClient class.
257+
*
258+
* @return an instance of ExtensibleStringsClient.
259+
*/
260+
@Metadata(properties = { MetadataProperties.GENERATED })
261+
public ExtensibleStringsClient buildExtensibleStringsClient() {
262+
SpecialWordsClientImpl innerClient = buildInnerClient();
263+
return new ExtensibleStringsClient(innerClient.getExtensibleStrings(), innerClient.getInstrumentation());
264+
}
265+
255266
/**
256267
* Builds an instance of OperationsClient class.
257268
*
@@ -273,15 +284,4 @@ public ParametersClient buildParametersClient() {
273284
SpecialWordsClientImpl innerClient = buildInnerClient();
274285
return new ParametersClient(innerClient.getParameters(), innerClient.getInstrumentation());
275286
}
276-
277-
/**
278-
* Builds an instance of ExtensibleStringsClient class.
279-
*
280-
* @return an instance of ExtensibleStringsClient.
281-
*/
282-
@Metadata(properties = { MetadataProperties.GENERATED })
283-
public ExtensibleStringsClient buildExtensibleStringsClient() {
284-
SpecialWordsClientImpl innerClient = buildInnerClient();
285-
return new ExtensibleStringsClient(innerClient.getExtensibleStrings(), innerClient.getInstrumentation());
286-
}
287287
}

0 commit comments

Comments
 (0)