Skip to content

http-client-java, support apiVersions property in metadata.json#9725

Draft
weidongxu-microsoft wants to merge 7 commits intomicrosoft:mainfrom
weidongxu-microsoft:http-client-java_update-metadata-file
Draft

http-client-java, support apiVersions property in metadata.json#9725
weidongxu-microsoft wants to merge 7 commits intomicrosoft:mainfrom
weidongxu-microsoft:http-client-java_update-metadata-file

Conversation

@weidongxu-microsoft
Copy link
Contributor

@weidongxu-microsoft weidongxu-microsoft commented Feb 14, 2026

Fix Azure/autorest.java#3265

Sample

{"flavor":"Azure","apiVersions":{"Azure.ResourceManager.MultiServiceOlderVersions.Compute":"2024-11-01","Azure.ResourceManager.MultiServiceOlderVersions.ComputeDisk":"2024-03-02"},

Also affect pom.xml and other md file.

E.g. for mixed version, description will now be

Package api-version Azure.ResourceManager.MultiServiceOlderVersions.Compute: 2024-11-01, Azure.ResourceManager.MultiServiceOlderVersions.ComputeDisk: 2024-03-02

instead of

Package api-version 2024-11-01

apiview JSON file is no longer generated

@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 Feb 14, 2026
@weidongxu-microsoft weidongxu-microsoft changed the title http-client-java, update metadata for apiVersions http-client-java, update metadata.json file for apiVersions property Feb 14, 2026
@weidongxu-microsoft weidongxu-microsoft changed the title http-client-java, update metadata.json file for apiVersions property http-client-java, support apiVersions property in metadata.json Feb 14, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 14, 2026

All changed packages have been documented.

  • @typespec/http-client-java
Show changes

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

Support apiVersions in metadata.json file.

@weidongxu-microsoft weidongxu-microsoft force-pushed the http-client-java_update-metadata-file branch from 13ae3c4 to aec86f9 Compare February 14, 2026 06:37
@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 14, 2026

Open in StackBlitz

npm i https://pkg.pr.new/microsoft/typespec/@typespec/http@9725
npm i https://pkg.pr.new/microsoft/typespec/@typespec/http-client@9725
npm i https://pkg.pr.new/microsoft/typespec/@typespec/http-client-java@9725

commit: bf00b29

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for the apiVersions property in metadata.json, transitioning from a single apiVersion string to a map of TypeSpec namespace to API version. This change enables support for services that use multiple API versions across different namespaces, as mentioned in the linked issue.

Changes:

  • Changed metadata.json schema from single apiVersion string to apiVersions map (namespace → version)
  • Removed deprecated apiview_properties.json file generation
  • Updated FluentProject to handle multiple API versions in service descriptions

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
MetadataUtil.java Removed unused getLatestApiVersionFromClient method that is no longer needed
TypeSpecFluentPlugin.java Updated to pass apiVersionMap instead of single apiVersion to methods
TypeSpecPlugin.java Updated to pass codeModel.getApiVersionMap() to metadata constructor
FluentProject.java Enhanced to format service description with single or multiple API versions
FluentGen.java Updated method signature to accept Map<String, String> for API versions
JavaPackage.java Removed deprecated apiview_properties.json generation code
TypeSpecMetadata.java Changed from single apiVersion field to apiVersions map with updated JSON serialization
Client.java Added apiVersionMap field (LinkedHashMap) to store namespace-to-version mappings
code-model.ts Added optional apiVersionMap field to CodeModel interface
client.ts Updated comment clarifying serviceVersion is for ServiceVersion class
code-model-builder.ts Added code to populate apiVersionMap from TCGC metadata
http-client-java_update-metadata-file-2026-1-14-14-41-22.md Added changelog entry for the feature

@azure-sdk
Copy link
Collaborator

azure-sdk commented Feb 14, 2026

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

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.

Emit multiple api-versions in our metadata file for multiple services

2 participants