Skip to content

Commit 30be58d

Browse files
http-client-java: update Node.js dependencies to latest (#9677)
A bug fix on XML pagenation included 3faefd8 E2e test is added to verify it works for XML 10e3e1f --- Updates all Node.js dependencies to their latest versions across the http-client-java package and test suites. ## Dependencies Updated - **TypeSpec core** (1.8.0 → 1.9.0): compiler, http, openapi, json-schema - **TypeSpec libraries** (0.78.0 → 0.79.0): events, rest, sse, streams, versioning, xml - **Azure tooling** (0.64.x → 0.65.0): autorest, azure-core, azure-resource-manager, client-generator-core, azure-rulesets - **Test specifications**: http-specs (α.31 → α.32), azure-http-specs (α.36 → α.37), spector (α.22 → α.23) ## Changes - Updated `package.json` in root and both test directories (http-client-generator-test, http-client-generator-clientcore-test) - Synchronized `peerDependencies` with `devDependencies` versions - Updated `overrides` in test packages to match root versions - Regenerated test code to align with updated http-specs and azure-http-specs <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/microsoft/typespec/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo. --------- 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 f087a91 commit 30be58d

File tree

218 files changed

+24003
-705
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

218 files changed

+24003
-705
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 Node.js dependencies to latest versions
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
changeKind: fix
3+
packages:
4+
- "@typespec/http-client-java"
5+
---
6+
7+
Fix incorrect variable name of continuationToken

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

Lines changed: 16 additions & 16 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.22",
15+
"@typespec/spector": "0.1.0-alpha.23",
1616
"@typespec/spec-api": "0.1.0-alpha.12",
17-
"@typespec/http-specs": "0.1.0-alpha.31",
18-
"@typespec/json-schema": "1.8.0",
17+
"@typespec/http-specs": "0.1.0-alpha.32",
18+
"@typespec/json-schema": "1.9.0",
1919
"@typespec/http-client-java": "file:../../typespec-http-client-java-0.6.1.tgz",
2020
"@typespec/http-client-java-tests": "file:"
2121
},
2222
"overrides": {
23-
"@typespec/compiler": "1.8.0",
24-
"@typespec/http": "1.8.0",
25-
"@typespec/rest": "0.78.0",
26-
"@typespec/versioning": "0.78.0",
27-
"@typespec/openapi": "1.8.0",
28-
"@typespec/xml": "0.78.0",
29-
"@typespec/events": "0.78.0",
30-
"@typespec/sse": "0.78.0",
31-
"@typespec/streams": "0.78.0",
32-
"@azure-tools/typespec-azure-core": "0.64.0",
33-
"@azure-tools/typespec-client-generator-core": "0.64.6",
34-
"@azure-tools/typespec-azure-resource-manager": "0.64.1",
35-
"@azure-tools/typespec-autorest": "0.64.1"
23+
"@typespec/compiler": "1.9.0",
24+
"@typespec/http": "1.9.0",
25+
"@typespec/rest": "0.79.0",
26+
"@typespec/versioning": "0.79.0",
27+
"@typespec/openapi": "1.9.0",
28+
"@typespec/xml": "0.79.0",
29+
"@typespec/events": "0.79.0",
30+
"@typespec/sse": "0.79.0",
31+
"@typespec/streams": "0.79.0",
32+
"@azure-tools/typespec-azure-core": "0.65.0",
33+
"@azure-tools/typespec-client-generator-core": "0.65.0",
34+
"@azure-tools/typespec-azure-resource-manager": "0.65.0",
35+
"@azure-tools/typespec-autorest": "0.65.0"
3636
},
3737
"private": true
3838
}

packages/http-client-java/generator/http-client-generator-clientcore-test/src/main/java/encode/array/ArrayClient.java

Lines changed: 272 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,4 +164,276 @@ public Response<NewlineDelimitedArrayProperty> newlineDelimitedWithResponse(Newl
164164
public NewlineDelimitedArrayProperty newlineDelimited(NewlineDelimitedArrayProperty body) {
165165
return newlineDelimitedWithResponse(body, RequestContext.none()).getValue();
166166
}
167+
168+
/**
169+
* The enumCommaDelimited operation.
170+
*
171+
* @param body The body parameter.
172+
* @param requestContext The context to configure the HTTP request before HTTP client sends it.
173+
* @throws IllegalArgumentException thrown if parameters fail the validation.
174+
* @throws HttpResponseException thrown if the service returns an error.
175+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
176+
* @return the response body along with {@link Response}.
177+
*/
178+
@Metadata(properties = { MetadataProperties.GENERATED })
179+
@ServiceMethod(returns = ReturnType.SINGLE)
180+
public Response<CommaDelimitedEnumArrayProperty>
181+
enumCommaDelimitedWithResponse(CommaDelimitedEnumArrayProperty body, RequestContext requestContext) {
182+
return this.instrumentation.instrumentWithResponse("Encode.Array.Property.enumCommaDelimited", requestContext,
183+
updatedContext -> this.serviceClient.enumCommaDelimitedWithResponse(body, updatedContext));
184+
}
185+
186+
/**
187+
* The enumCommaDelimited operation.
188+
*
189+
* @param body The body parameter.
190+
* @throws IllegalArgumentException thrown if parameters fail the validation.
191+
* @throws HttpResponseException thrown if the service returns an error.
192+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
193+
* @return the response.
194+
*/
195+
@Metadata(properties = { MetadataProperties.GENERATED })
196+
@ServiceMethod(returns = ReturnType.SINGLE)
197+
public CommaDelimitedEnumArrayProperty enumCommaDelimited(CommaDelimitedEnumArrayProperty body) {
198+
return enumCommaDelimitedWithResponse(body, RequestContext.none()).getValue();
199+
}
200+
201+
/**
202+
* The enumSpaceDelimited operation.
203+
*
204+
* @param body The body parameter.
205+
* @param requestContext The context to configure the HTTP request before HTTP client sends it.
206+
* @throws IllegalArgumentException thrown if parameters fail the validation.
207+
* @throws HttpResponseException thrown if the service returns an error.
208+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
209+
* @return the response body along with {@link Response}.
210+
*/
211+
@Metadata(properties = { MetadataProperties.GENERATED })
212+
@ServiceMethod(returns = ReturnType.SINGLE)
213+
public Response<SpaceDelimitedEnumArrayProperty>
214+
enumSpaceDelimitedWithResponse(SpaceDelimitedEnumArrayProperty body, RequestContext requestContext) {
215+
return this.instrumentation.instrumentWithResponse("Encode.Array.Property.enumSpaceDelimited", requestContext,
216+
updatedContext -> this.serviceClient.enumSpaceDelimitedWithResponse(body, updatedContext));
217+
}
218+
219+
/**
220+
* The enumSpaceDelimited operation.
221+
*
222+
* @param body The body parameter.
223+
* @throws IllegalArgumentException thrown if parameters fail the validation.
224+
* @throws HttpResponseException thrown if the service returns an error.
225+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
226+
* @return the response.
227+
*/
228+
@Metadata(properties = { MetadataProperties.GENERATED })
229+
@ServiceMethod(returns = ReturnType.SINGLE)
230+
public SpaceDelimitedEnumArrayProperty enumSpaceDelimited(SpaceDelimitedEnumArrayProperty body) {
231+
return enumSpaceDelimitedWithResponse(body, RequestContext.none()).getValue();
232+
}
233+
234+
/**
235+
* The enumPipeDelimited operation.
236+
*
237+
* @param body The body parameter.
238+
* @param requestContext The context to configure the HTTP request before HTTP client sends it.
239+
* @throws IllegalArgumentException thrown if parameters fail the validation.
240+
* @throws HttpResponseException thrown if the service returns an error.
241+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
242+
* @return the response body along with {@link Response}.
243+
*/
244+
@Metadata(properties = { MetadataProperties.GENERATED })
245+
@ServiceMethod(returns = ReturnType.SINGLE)
246+
public Response<PipeDelimitedEnumArrayProperty> enumPipeDelimitedWithResponse(PipeDelimitedEnumArrayProperty body,
247+
RequestContext requestContext) {
248+
return this.instrumentation.instrumentWithResponse("Encode.Array.Property.enumPipeDelimited", requestContext,
249+
updatedContext -> this.serviceClient.enumPipeDelimitedWithResponse(body, updatedContext));
250+
}
251+
252+
/**
253+
* The enumPipeDelimited operation.
254+
*
255+
* @param body The body parameter.
256+
* @throws IllegalArgumentException thrown if parameters fail the validation.
257+
* @throws HttpResponseException thrown if the service returns an error.
258+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
259+
* @return the response.
260+
*/
261+
@Metadata(properties = { MetadataProperties.GENERATED })
262+
@ServiceMethod(returns = ReturnType.SINGLE)
263+
public PipeDelimitedEnumArrayProperty enumPipeDelimited(PipeDelimitedEnumArrayProperty body) {
264+
return enumPipeDelimitedWithResponse(body, RequestContext.none()).getValue();
265+
}
266+
267+
/**
268+
* The enumNewlineDelimited operation.
269+
*
270+
* @param body The body parameter.
271+
* @param requestContext The context to configure the HTTP request before HTTP client sends it.
272+
* @throws IllegalArgumentException thrown if parameters fail the validation.
273+
* @throws HttpResponseException thrown if the service returns an error.
274+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
275+
* @return the response body along with {@link Response}.
276+
*/
277+
@Metadata(properties = { MetadataProperties.GENERATED })
278+
@ServiceMethod(returns = ReturnType.SINGLE)
279+
public Response<NewlineDelimitedEnumArrayProperty>
280+
enumNewlineDelimitedWithResponse(NewlineDelimitedEnumArrayProperty body, RequestContext requestContext) {
281+
return this.instrumentation.instrumentWithResponse("Encode.Array.Property.enumNewlineDelimited", requestContext,
282+
updatedContext -> this.serviceClient.enumNewlineDelimitedWithResponse(body, updatedContext));
283+
}
284+
285+
/**
286+
* The enumNewlineDelimited operation.
287+
*
288+
* @param body The body parameter.
289+
* @throws IllegalArgumentException thrown if parameters fail the validation.
290+
* @throws HttpResponseException thrown if the service returns an error.
291+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
292+
* @return the response.
293+
*/
294+
@Metadata(properties = { MetadataProperties.GENERATED })
295+
@ServiceMethod(returns = ReturnType.SINGLE)
296+
public NewlineDelimitedEnumArrayProperty enumNewlineDelimited(NewlineDelimitedEnumArrayProperty body) {
297+
return enumNewlineDelimitedWithResponse(body, RequestContext.none()).getValue();
298+
}
299+
300+
/**
301+
* The extensibleEnumCommaDelimited operation.
302+
*
303+
* @param body The body parameter.
304+
* @param requestContext The context to configure the HTTP request before HTTP client sends it.
305+
* @throws IllegalArgumentException thrown if parameters fail the validation.
306+
* @throws HttpResponseException thrown if the service returns an error.
307+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
308+
* @return the response body along with {@link Response}.
309+
*/
310+
@Metadata(properties = { MetadataProperties.GENERATED })
311+
@ServiceMethod(returns = ReturnType.SINGLE)
312+
public Response<CommaDelimitedExtensibleEnumArrayProperty> extensibleEnumCommaDelimitedWithResponse(
313+
CommaDelimitedExtensibleEnumArrayProperty body, RequestContext requestContext) {
314+
return this.instrumentation.instrumentWithResponse("Encode.Array.Property.extensibleEnumCommaDelimited",
315+
requestContext,
316+
updatedContext -> this.serviceClient.extensibleEnumCommaDelimitedWithResponse(body, updatedContext));
317+
}
318+
319+
/**
320+
* The extensibleEnumCommaDelimited operation.
321+
*
322+
* @param body The body parameter.
323+
* @throws IllegalArgumentException thrown if parameters fail the validation.
324+
* @throws HttpResponseException thrown if the service returns an error.
325+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
326+
* @return the response.
327+
*/
328+
@Metadata(properties = { MetadataProperties.GENERATED })
329+
@ServiceMethod(returns = ReturnType.SINGLE)
330+
public CommaDelimitedExtensibleEnumArrayProperty
331+
extensibleEnumCommaDelimited(CommaDelimitedExtensibleEnumArrayProperty body) {
332+
return extensibleEnumCommaDelimitedWithResponse(body, RequestContext.none()).getValue();
333+
}
334+
335+
/**
336+
* The extensibleEnumSpaceDelimited operation.
337+
*
338+
* @param body The body parameter.
339+
* @param requestContext The context to configure the HTTP request before HTTP client sends it.
340+
* @throws IllegalArgumentException thrown if parameters fail the validation.
341+
* @throws HttpResponseException thrown if the service returns an error.
342+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
343+
* @return the response body along with {@link Response}.
344+
*/
345+
@Metadata(properties = { MetadataProperties.GENERATED })
346+
@ServiceMethod(returns = ReturnType.SINGLE)
347+
public Response<SpaceDelimitedExtensibleEnumArrayProperty> extensibleEnumSpaceDelimitedWithResponse(
348+
SpaceDelimitedExtensibleEnumArrayProperty body, RequestContext requestContext) {
349+
return this.instrumentation.instrumentWithResponse("Encode.Array.Property.extensibleEnumSpaceDelimited",
350+
requestContext,
351+
updatedContext -> this.serviceClient.extensibleEnumSpaceDelimitedWithResponse(body, updatedContext));
352+
}
353+
354+
/**
355+
* The extensibleEnumSpaceDelimited operation.
356+
*
357+
* @param body The body parameter.
358+
* @throws IllegalArgumentException thrown if parameters fail the validation.
359+
* @throws HttpResponseException thrown if the service returns an error.
360+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
361+
* @return the response.
362+
*/
363+
@Metadata(properties = { MetadataProperties.GENERATED })
364+
@ServiceMethod(returns = ReturnType.SINGLE)
365+
public SpaceDelimitedExtensibleEnumArrayProperty
366+
extensibleEnumSpaceDelimited(SpaceDelimitedExtensibleEnumArrayProperty body) {
367+
return extensibleEnumSpaceDelimitedWithResponse(body, RequestContext.none()).getValue();
368+
}
369+
370+
/**
371+
* The extensibleEnumPipeDelimited operation.
372+
*
373+
* @param body The body parameter.
374+
* @param requestContext The context to configure the HTTP request before HTTP client sends it.
375+
* @throws IllegalArgumentException thrown if parameters fail the validation.
376+
* @throws HttpResponseException thrown if the service returns an error.
377+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
378+
* @return the response body along with {@link Response}.
379+
*/
380+
@Metadata(properties = { MetadataProperties.GENERATED })
381+
@ServiceMethod(returns = ReturnType.SINGLE)
382+
public Response<PipeDelimitedExtensibleEnumArrayProperty> extensibleEnumPipeDelimitedWithResponse(
383+
PipeDelimitedExtensibleEnumArrayProperty body, RequestContext requestContext) {
384+
return this.instrumentation.instrumentWithResponse("Encode.Array.Property.extensibleEnumPipeDelimited",
385+
requestContext,
386+
updatedContext -> this.serviceClient.extensibleEnumPipeDelimitedWithResponse(body, updatedContext));
387+
}
388+
389+
/**
390+
* The extensibleEnumPipeDelimited operation.
391+
*
392+
* @param body The body parameter.
393+
* @throws IllegalArgumentException thrown if parameters fail the validation.
394+
* @throws HttpResponseException thrown if the service returns an error.
395+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
396+
* @return the response.
397+
*/
398+
@Metadata(properties = { MetadataProperties.GENERATED })
399+
@ServiceMethod(returns = ReturnType.SINGLE)
400+
public PipeDelimitedExtensibleEnumArrayProperty
401+
extensibleEnumPipeDelimited(PipeDelimitedExtensibleEnumArrayProperty body) {
402+
return extensibleEnumPipeDelimitedWithResponse(body, RequestContext.none()).getValue();
403+
}
404+
405+
/**
406+
* The extensibleEnumNewlineDelimited operation.
407+
*
408+
* @param body The body parameter.
409+
* @param requestContext The context to configure the HTTP request before HTTP client sends it.
410+
* @throws IllegalArgumentException thrown if parameters fail the validation.
411+
* @throws HttpResponseException thrown if the service returns an error.
412+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
413+
* @return the response body along with {@link Response}.
414+
*/
415+
@Metadata(properties = { MetadataProperties.GENERATED })
416+
@ServiceMethod(returns = ReturnType.SINGLE)
417+
public Response<NewlineDelimitedExtensibleEnumArrayProperty> extensibleEnumNewlineDelimitedWithResponse(
418+
NewlineDelimitedExtensibleEnumArrayProperty body, RequestContext requestContext) {
419+
return this.instrumentation.instrumentWithResponse("Encode.Array.Property.extensibleEnumNewlineDelimited",
420+
requestContext,
421+
updatedContext -> this.serviceClient.extensibleEnumNewlineDelimitedWithResponse(body, updatedContext));
422+
}
423+
424+
/**
425+
* The extensibleEnumNewlineDelimited operation.
426+
*
427+
* @param body The body parameter.
428+
* @throws IllegalArgumentException thrown if parameters fail the validation.
429+
* @throws HttpResponseException thrown if the service returns an error.
430+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
431+
* @return the response.
432+
*/
433+
@Metadata(properties = { MetadataProperties.GENERATED })
434+
@ServiceMethod(returns = ReturnType.SINGLE)
435+
public NewlineDelimitedExtensibleEnumArrayProperty
436+
extensibleEnumNewlineDelimited(NewlineDelimitedExtensibleEnumArrayProperty body) {
437+
return extensibleEnumNewlineDelimitedWithResponse(body, RequestContext.none()).getValue();
438+
}
167439
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
package encode.array;
2+
3+
/**
4+
* Defines values for Colors.
5+
*/
6+
public enum Colors {
7+
/**
8+
* Enum value blue.
9+
*/
10+
BLUE("blue"),
11+
12+
/**
13+
* Enum value red.
14+
*/
15+
RED("red"),
16+
17+
/**
18+
* Enum value green.
19+
*/
20+
GREEN("green");
21+
22+
/**
23+
* The actual serialized value for a Colors instance.
24+
*/
25+
private final String value;
26+
27+
Colors(String value) {
28+
this.value = value;
29+
}
30+
31+
/**
32+
* Parses a serialized value to a Colors instance.
33+
*
34+
* @param value the serialized value to parse.
35+
* @return the parsed Colors object, or null if unable to parse.
36+
*/
37+
public static Colors fromString(String value) {
38+
if (value == null) {
39+
return null;
40+
}
41+
Colors[] items = Colors.values();
42+
for (Colors item : items) {
43+
if (item.toString().equalsIgnoreCase(value)) {
44+
return item;
45+
}
46+
}
47+
return null;
48+
}
49+
50+
/**
51+
* {@inheritDoc}
52+
*/
53+
@Override
54+
public String toString() {
55+
return this.value;
56+
}
57+
}

0 commit comments

Comments
 (0)