Skip to content

Commit a964f34

Browse files
chore(http-client-java): update Node.js dependencies (#10296)
Bumps all Node.js dependencies for `@typespec/http-client-java` to latest versions and regenerates affected test sources. ## Dependency updates - **TypeSpec core** (`@typespec/compiler`, `http`, `openapi`, `rest`, `versioning`, `events`, `sse`, `streams`, `xml`): `1.10.0`/`0.80.0` → `1.11.0`/`0.81.0` - **Azure tools** (`typespec-autorest`, `typespec-azure-core`, `typespec-azure-resource-manager`, `typespec-azure-rulesets`, `typespec-client-generator-core`): `0.66.x` → `0.67.0` - **Test specs** (`@typespec/http-specs`): `0.1.0-alpha.35` → `0.1.0-alpha.36`; (`@azure-tools/azure-http-specs`): `0.1.0-alpha.38` → `0.1.0-alpha.39` - **Tooling**: `vitest` `4.1.2` → `4.1.3`, `@types/node` `25.5.0` → `25.5.2`, `@microsoft/api-extractor` `7.58.0` → `7.58.1` - `peerDependencies` ranges updated to match new minimum versions - `overrides` in both test `package.json` files aligned to root `devDependencies` ## Regenerated test sources Re-ran `Generate.ps1` in both `http-client-generator-test` and `http-client-generator-clientcore-test` to pick up changes from the updated `http-specs` and `azure-http-specs` packages. Notable new generated artifacts include clients for multi-service scenarios, naming sub-clients, and `DownloadFileMultipleContentTypesContentType` enum. --------- 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> Co-authored-by: Weidong Xu <weidxu@microsoft.com>
1 parent a09825f commit a964f34

55 files changed

Lines changed: 2031 additions & 1516 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
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 Node.js dependencies

packages/http-client-java/emitter/src/code-model-builder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,7 +941,7 @@ export class CodeModelBuilder {
941941
let generateProtocolApi: boolean = sdkMethod.generateProtocol;
942942

943943
let diagnostic = undefined;
944-
if (generateConvenienceApi) {
944+
if (generateConvenienceApi && this.isAzureV1()) {
945945
// check if the convenience API need to be disabled for some special cases
946946
if (operationIsMultipart(httpOperation)) {
947947
// do not generate protocol method for multipart/form-data, as it be very hard for user to prepare the request body as BinaryData

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

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,27 +12,27 @@
1212
"spector-stop": "tsp-spector server stop"
1313
},
1414
"dependencies": {
15-
"@typespec/spector": "0.1.0-alpha.24",
16-
"@typespec/spec-api": "0.1.0-alpha.13",
17-
"@typespec/http-specs": "0.1.0-alpha.35",
18-
"@typespec/json-schema": "1.10.0",
15+
"@typespec/spector": "0.1.0-alpha.25",
16+
"@typespec/spec-api": "0.1.0-alpha.14",
17+
"@typespec/http-specs": "0.1.0-alpha.36",
18+
"@typespec/json-schema": "1.11.0",
1919
"@typespec/http-client-java": "file:../../typespec-http-client-java-0.7.0.tgz",
2020
"@typespec/http-client-java-tests": "file:"
2121
},
2222
"overrides": {
23-
"@typespec/compiler": "1.10.0",
24-
"@typespec/http": "1.10.0",
25-
"@typespec/rest": "0.80.0",
26-
"@typespec/versioning": "0.80.0",
27-
"@typespec/openapi": "1.10.0",
28-
"@typespec/xml": "0.80.0",
29-
"@typespec/events": "0.80.0",
30-
"@typespec/sse": "0.80.0",
31-
"@typespec/streams": "0.80.0",
32-
"@azure-tools/typespec-azure-core": "0.66.1",
33-
"@azure-tools/typespec-client-generator-core": "0.66.4",
34-
"@azure-tools/typespec-azure-resource-manager": "0.66.1",
35-
"@azure-tools/typespec-autorest": "0.66.2"
23+
"@typespec/compiler": "1.11.0",
24+
"@typespec/http": "1.11.0",
25+
"@typespec/rest": "0.81.0",
26+
"@typespec/versioning": "0.81.0",
27+
"@typespec/openapi": "1.11.0",
28+
"@typespec/xml": "0.81.0",
29+
"@typespec/events": "0.81.0",
30+
"@typespec/sse": "0.81.0",
31+
"@typespec/streams": "0.81.0",
32+
"@azure-tools/typespec-azure-core": "0.67.0",
33+
"@azure-tools/typespec-client-generator-core": "0.67.0",
34+
"@azure-tools/typespec-azure-resource-manager": "0.67.0",
35+
"@azure-tools/typespec-autorest": "0.67.0"
3636
},
3737
"private": true
3838
}

packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/payload/multipart/FormDataClient.java

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ public final class FormDataClient {
4747
@Metadata(properties = { MetadataProperties.GENERATED })
4848
@ServiceMethod(returns = ReturnType.SINGLE)
4949
public Response<Void> basicWithResponse(MultiPartRequest body, RequestContext requestContext) {
50-
// Operation 'basic' is of content-type 'multipart/form-data'. Protocol API is not usable and hence not
51-
// generated.
5250
return this.instrumentation.instrumentWithResponse("Payload.MultiPart.FormData.basic", requestContext,
5351
updatedContext -> this.serviceClient.basicWithResponse(body, updatedContext));
5452
}
@@ -80,8 +78,6 @@ public void basic(MultiPartRequest body) {
8078
@Metadata(properties = { MetadataProperties.GENERATED })
8179
@ServiceMethod(returns = ReturnType.SINGLE)
8280
public Response<Void> withWireNameWithResponse(MultiPartRequestWithWireName body, RequestContext requestContext) {
83-
// Operation 'withWireName' is of content-type 'multipart/form-data'. Protocol API is not usable and hence not
84-
// generated.
8581
return this.instrumentation.instrumentWithResponse("Payload.MultiPart.FormData.withWireName", requestContext,
8682
updatedContext -> this.serviceClient.withWireNameWithResponse(body, updatedContext));
8783
}
@@ -113,8 +109,6 @@ public void withWireName(MultiPartRequestWithWireName body) {
113109
@Metadata(properties = { MetadataProperties.GENERATED })
114110
@ServiceMethod(returns = ReturnType.SINGLE)
115111
public Response<Void> optionalPartsWithResponse(MultiPartOptionalRequest body, RequestContext requestContext) {
116-
// Operation 'optionalParts' is of content-type 'multipart/form-data'. Protocol API is not usable and hence not
117-
// generated.
118112
return this.instrumentation.instrumentWithResponse("Payload.MultiPart.FormData.optionalParts", requestContext,
119113
updatedContext -> this.serviceClient.optionalPartsWithResponse(body, updatedContext));
120114
}
@@ -146,8 +140,6 @@ public void optionalParts(MultiPartOptionalRequest body) {
146140
@Metadata(properties = { MetadataProperties.GENERATED })
147141
@ServiceMethod(returns = ReturnType.SINGLE)
148142
public Response<Void> fileArrayAndBasicWithResponse(ComplexPartsRequest body, RequestContext requestContext) {
149-
// Operation 'fileArrayAndBasic' is of content-type 'multipart/form-data'. Protocol API is not usable and hence
150-
// not generated.
151143
return this.instrumentation.instrumentWithResponse("Payload.MultiPart.FormData.fileArrayAndBasic",
152144
requestContext, updatedContext -> this.serviceClient.fileArrayAndBasicWithResponse(body, updatedContext));
153145
}
@@ -179,8 +171,6 @@ public void fileArrayAndBasic(ComplexPartsRequest body) {
179171
@Metadata(properties = { MetadataProperties.GENERATED })
180172
@ServiceMethod(returns = ReturnType.SINGLE)
181173
public Response<Void> jsonPartWithResponse(JsonPartRequest body, RequestContext requestContext) {
182-
// Operation 'jsonPart' is of content-type 'multipart/form-data'. Protocol API is not usable and hence not
183-
// generated.
184174
return this.instrumentation.instrumentWithResponse("Payload.MultiPart.FormData.jsonPart", requestContext,
185175
updatedContext -> this.serviceClient.jsonPartWithResponse(body, updatedContext));
186176
}
@@ -212,8 +202,6 @@ public void jsonPart(JsonPartRequest body) {
212202
@Metadata(properties = { MetadataProperties.GENERATED })
213203
@ServiceMethod(returns = ReturnType.SINGLE)
214204
public Response<Void> binaryArrayPartsWithResponse(BinaryArrayPartsRequest body, RequestContext requestContext) {
215-
// Operation 'binaryArrayParts' is of content-type 'multipart/form-data'. Protocol API is not usable and hence
216-
// not generated.
217205
return this.instrumentation.instrumentWithResponse("Payload.MultiPart.FormData.binaryArrayParts",
218206
requestContext, updatedContext -> this.serviceClient.binaryArrayPartsWithResponse(body, updatedContext));
219207
}
@@ -245,8 +233,6 @@ public void binaryArrayParts(BinaryArrayPartsRequest body) {
245233
@Metadata(properties = { MetadataProperties.GENERATED })
246234
@ServiceMethod(returns = ReturnType.SINGLE)
247235
public Response<Void> multiBinaryPartsWithResponse(MultiBinaryPartsRequest body, RequestContext requestContext) {
248-
// Operation 'multiBinaryParts' is of content-type 'multipart/form-data'. Protocol API is not usable and hence
249-
// not generated.
250236
return this.instrumentation.instrumentWithResponse("Payload.MultiPart.FormData.multiBinaryParts",
251237
requestContext, updatedContext -> this.serviceClient.multiBinaryPartsWithResponse(body, updatedContext));
252238
}
@@ -279,8 +265,6 @@ public void multiBinaryParts(MultiBinaryPartsRequest body) {
279265
@ServiceMethod(returns = ReturnType.SINGLE)
280266
public Response<Void> checkFileNameAndContentTypeWithResponse(MultiPartRequest body,
281267
RequestContext requestContext) {
282-
// Operation 'checkFileNameAndContentType' is of content-type 'multipart/form-data'. Protocol API is not usable
283-
// and hence not generated.
284268
return this.instrumentation.instrumentWithResponse("Payload.MultiPart.FormData.checkFileNameAndContentType",
285269
requestContext,
286270
updatedContext -> this.serviceClient.checkFileNameAndContentTypeWithResponse(body, updatedContext));
@@ -313,8 +297,6 @@ public void checkFileNameAndContentType(MultiPartRequest body) {
313297
@Metadata(properties = { MetadataProperties.GENERATED })
314298
@ServiceMethod(returns = ReturnType.SINGLE)
315299
public Response<Void> anonymousModelWithResponse(AnonymousModelRequest body, RequestContext requestContext) {
316-
// Operation 'anonymousModel' is of content-type 'multipart/form-data'. Protocol API is not usable and hence not
317-
// generated.
318300
return this.instrumentation.instrumentWithResponse("Payload.MultiPart.FormData.anonymousModel", requestContext,
319301
updatedContext -> this.serviceClient.anonymousModelWithResponse(body, updatedContext));
320302
}

packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/payload/multipart/FormDataFileClient.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ public final class FormDataFileClient {
5050
@ServiceMethod(returns = ReturnType.SINGLE)
5151
public Response<Void> uploadFileSpecificContentTypeWithResponse(UploadFileSpecificContentTypeRequest body,
5252
RequestContext requestContext) {
53-
// Operation 'uploadFileSpecificContentType' is of content-type 'multipart/form-data'. Protocol API is not
54-
// usable and hence not generated.
5553
return this.instrumentation.instrumentWithResponse(
5654
"Payload.MultiPart.FormData.File.uploadFileSpecificContentType", requestContext,
5755
updatedContext -> this.serviceClient.uploadFileSpecificContentTypeWithResponse(body, updatedContext));
@@ -85,8 +83,6 @@ public void uploadFileSpecificContentType(UploadFileSpecificContentTypeRequest b
8583
@ServiceMethod(returns = ReturnType.SINGLE)
8684
public Response<Void> uploadFileRequiredFilenameWithResponse(UploadFileRequiredFilenameRequest body,
8785
RequestContext requestContext) {
88-
// Operation 'uploadFileRequiredFilename' is of content-type 'multipart/form-data'. Protocol API is not usable
89-
// and hence not generated.
9086
return this.instrumentation.instrumentWithResponse("Payload.MultiPart.FormData.File.uploadFileRequiredFilename",
9187
requestContext,
9288
updatedContext -> this.serviceClient.uploadFileRequiredFilenameWithResponse(body, updatedContext));
@@ -119,8 +115,6 @@ public void uploadFileRequiredFilename(UploadFileRequiredFilenameRequest body) {
119115
@Metadata(properties = { MetadataProperties.GENERATED })
120116
@ServiceMethod(returns = ReturnType.SINGLE)
121117
public Response<Void> uploadFileArrayWithResponse(UploadFileArrayRequest body, RequestContext requestContext) {
122-
// Operation 'uploadFileArray' is of content-type 'multipart/form-data'. Protocol API is not usable and hence
123-
// not generated.
124118
return this.instrumentation.instrumentWithResponse("Payload.MultiPart.FormData.File.uploadFileArray",
125119
requestContext, updatedContext -> this.serviceClient.uploadFileArrayWithResponse(body, updatedContext));
126120
}

packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/payload/multipart/FormDataHttpPartsClient.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ public final class FormDataHttpPartsClient {
4747
@ServiceMethod(returns = ReturnType.SINGLE)
4848
public Response<Void> jsonArrayAndFileArrayWithResponse(ComplexHttpPartsModelRequest body,
4949
RequestContext requestContext) {
50-
// Operation 'jsonArrayAndFileArray' is of content-type 'multipart/form-data'. Protocol API is not usable and
51-
// hence not generated.
5250
return this.instrumentation.instrumentWithResponse("Payload.MultiPart.FormData.HttpParts.jsonArrayAndFileArray",
5351
requestContext,
5452
updatedContext -> this.serviceClient.jsonArrayAndFileArrayWithResponse(body, updatedContext));

packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/payload/multipart/FormDataHttpPartsContentTypeClient.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ public final class FormDataHttpPartsContentTypeClient {
4848
@ServiceMethod(returns = ReturnType.SINGLE)
4949
public Response<Void> imageJpegContentTypeWithResponse(FileWithHttpPartSpecificContentTypeRequest body,
5050
RequestContext requestContext) {
51-
// Operation 'imageJpegContentType' is of content-type 'multipart/form-data'. Protocol API is not usable and
52-
// hence not generated.
5351
return this.instrumentation.instrumentWithResponse(
5452
"Payload.MultiPart.FormData.HttpParts.ContentType.imageJpegContentType", requestContext,
5553
updatedContext -> this.serviceClient.imageJpegContentTypeWithResponse(body, updatedContext));
@@ -83,8 +81,6 @@ public void imageJpegContentType(FileWithHttpPartSpecificContentTypeRequest body
8381
@ServiceMethod(returns = ReturnType.SINGLE)
8482
public Response<Void> requiredContentTypeWithResponse(FileWithHttpPartRequiredContentTypeRequest body,
8583
RequestContext requestContext) {
86-
// Operation 'requiredContentType' is of content-type 'multipart/form-data'. Protocol API is not usable and
87-
// hence not generated.
8884
return this.instrumentation.instrumentWithResponse(
8985
"Payload.MultiPart.FormData.HttpParts.ContentType.requiredContentType", requestContext,
9086
updatedContext -> this.serviceClient.requiredContentTypeWithResponse(body, updatedContext));
@@ -118,8 +114,6 @@ public void requiredContentType(FileWithHttpPartRequiredContentTypeRequest body)
118114
@ServiceMethod(returns = ReturnType.SINGLE)
119115
public Response<Void> optionalContentTypeWithResponse(FileWithHttpPartOptionalContentTypeRequest body,
120116
RequestContext requestContext) {
121-
// Operation 'optionalContentType' is of content-type 'multipart/form-data'. Protocol API is not usable and
122-
// hence not generated.
123117
return this.instrumentation.instrumentWithResponse(
124118
"Payload.MultiPart.FormData.HttpParts.ContentType.optionalContentType", requestContext,
125119
updatedContext -> this.serviceClient.optionalContentTypeWithResponse(body, updatedContext));

packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/payload/multipart/FormDataHttpPartsNonStringClient.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ public final class FormDataHttpPartsNonStringClient {
4747
@Metadata(properties = { MetadataProperties.GENERATED })
4848
@ServiceMethod(returns = ReturnType.SINGLE)
4949
public Response<Void> floatMethodWithResponse(FloatRequest body, RequestContext requestContext) {
50-
// Operation 'float' is of content-type 'multipart/form-data'. Protocol API is not usable and hence not
51-
// generated.
5250
return this.instrumentation.instrumentWithResponse("Payload.MultiPart.FormData.HttpParts.NonString.float",
5351
requestContext, updatedContext -> this.serviceClient.floatMethodWithResponse(body, updatedContext));
5452
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
package type.file;
2+
3+
/**
4+
* Defines values for DownloadFileMultipleContentTypesContentType.
5+
*/
6+
public enum DownloadFileMultipleContentTypesContentType {
7+
/**
8+
* Enum value image/png.
9+
*/
10+
IMAGE_PNG("image/png"),
11+
12+
/**
13+
* Enum value image/jpeg.
14+
*/
15+
IMAGE_JPEG("image/jpeg");
16+
17+
/**
18+
* The actual serialized value for a DownloadFileMultipleContentTypesContentType instance.
19+
*/
20+
private final String value;
21+
22+
DownloadFileMultipleContentTypesContentType(String value) {
23+
this.value = value;
24+
}
25+
26+
/**
27+
* Parses a serialized value to a DownloadFileMultipleContentTypesContentType instance.
28+
*
29+
* @param value the serialized value to parse.
30+
* @return the parsed DownloadFileMultipleContentTypesContentType object, or null if unable to parse.
31+
*/
32+
public static DownloadFileMultipleContentTypesContentType fromString(String value) {
33+
if (value == null) {
34+
return null;
35+
}
36+
DownloadFileMultipleContentTypesContentType[] items = DownloadFileMultipleContentTypesContentType.values();
37+
for (DownloadFileMultipleContentTypesContentType item : items) {
38+
if (item.toString().equalsIgnoreCase(value)) {
39+
return item;
40+
}
41+
}
42+
return null;
43+
}
44+
45+
/**
46+
* {@inheritDoc}
47+
*/
48+
@Override
49+
public String toString() {
50+
return this.value;
51+
}
52+
}

0 commit comments

Comments
 (0)