Skip to content

http-client-java, upgrade compiler to 1.10 - #9993

Merged
Weidong Xu (weidongxu-microsoft) merged 24 commits into
mainfrom
http-client-java_upgrade-compiler
Mar 12, 2026
Merged

Weidong Xu (weidongxu-microsoft) merged 24 commits into
mainfrom
http-client-java_upgrade-compiler

Conversation

@weidongxu-microsoft

@weidongxu-microsoft Weidong Xu (weidongxu-microsoft) commented Mar 11, 2026 •

Copy link
Copy Markdown
Contributor

misc included

  • enable tests that now get new azure-http-specs lib with fix
  • agent add tests
  • update code to switch from deprecated API

downstream
Azure/autorest.java#3301
Azure/azure-sdk-for-java#48382 <-- checking

@microsoft-github-policy-service microsoft-github-policy-service Bot added the emitter:client:java Issue for the Java client emitter: @typespec/http-client-java label Mar 11, 2026
@github-actions

github-actions Bot commented Mar 11, 2026 •

Copy link
Copy Markdown
Contributor

All changed packages have been documented.

  • ✅ @typespec/http-client-java
Show changes

@typespec/http-client-java - internal ✏️

Add missing tests for int32SecondsLargerUnit and floatSecondsLargerUnit encode/duration scenarios (query, header, and property).

@typespec/http-client-java - internal ✏️

Add e2e tests for client-initialization scenarios

@typespec/http-client-java - dependencies ✏️

Update compiler to 1.10.0

@typespec/http-client-java - fix ✏️

Allow text/plain content-type on Enum

@weidongxu-microsoft Weidong Xu (weidongxu-microsoft) changed the title http-client-java, upgrade compiler http-client-java, upgrade compiler to 1.10 Mar 11, 2026
@azure-sdk

Azure SDK Bot (azure-sdk) commented Mar 11, 2026 •

Copy link
Copy Markdown
Collaborator

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

…9994)

No e2e test coverage existed for the generated clients under
`azure/clientgenerator/core/clientinitialization`. Adds Spector-backed
tests for all three sub-packages against the `azure-http-specs` mock API
definitions.

## New test files

- **`DefaultClientTests.java`** — covers all 6 default clients:
`HeaderParam`, `MultipleParams`, `MixedParams`, `PathParam`,
`ParamAlias`, `QueryParam`
- **`IndividuallyClientTests.java`** — covers 6 individually-configured
nested clients (path, query, header, multiple, mixed, paramAlias
variants)
- **`IndividuallyParentClientTests.java`** — covers the parent factory
pattern where `IndividuallyParentClient` spawns typed child clients

## Test values

Derived directly from `mockapi.ts` in `azure-http-specs`:

| Param | Value |
|---|---|
| `name` (header) | `test-name-value` |
| `blobName` (query/path) | `test-blob` or `sample-blob` |
| `region` | `us-west` |

## Example

```java
// DefaultClientTests — mixed params: name stored in client, region+id as method args
MixedParamsClient mixedParamsClient = new MixedParamsClientBuilder()
    .name("test-name-value")
    .buildClient();
mixedParamsClient.withQuery("us-west", "test-id");
mixedParamsClient.withBody("us-west", new WithBodyRequest("test-name"));

// IndividuallyParentClientTests — factory pattern
IndividuallyParentClient parentClient = new IndividuallyParentClientBuilder().buildClient();
IndividuallyParentNestedWithPathClient pathClient =
    parentClient.getIndividuallyParentNestedWithPathClient("test-blob");
BlobProperties props = pathClient.getStandalone();
```

---------

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>
@weidongxu-microsoft
Weidong Xu (weidongxu-microsoft) marked this pull request as ready for review March 11, 2026 08:12
Merged via the queue into main with commit 220429d Mar 12, 2026
31 checks passed
@weidongxu-microsoft
Weidong Xu (weidongxu-microsoft) deleted the http-client-java_upgrade-compiler branch March 12, 2026 02:10
Weidong Xu (weidongxu-microsoft) added a commit to Azure/autorest.java that referenced this pull request Mar 12, 2026
* Initial plan

* update node.js dependencies: sync core to PR #9993, update packages to latest

Co-authored-by: weidongxu-microsoft <53292327+weidongxu-microsoft@users.noreply.github.com>

* prepare release 0.43.0, sync tests, delete loadtesting patch

Co-authored-by: weidongxu-microsoft <53292327+weidongxu-microsoft@users.noreply.github.com>

* core on main

---------

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:java Issue for the Java client emitter: @typespec/http-client-java

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants