-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Generate code from TypeSpec
Java Azure SDK Design Guidelines is the overall design guideline of the client SDK. Make sure you are familiar with concepts such as "Service Client" and "Packaging".
Make sure you are familiar with Git and Maven, especially the Build Lifecycle.
☑️ The package structure in the azure-rest-api-specs repository should follow these guidelines.
Here is a sample for tspconfig.yaml.
Please make sure service-dir
, package-dir
, namespace
(for typespec-java) is correctly configured.
- "parameters.service-dir.default" would be
sdk/<service>
- "options.@azure-tools/typespec-java.package-dir" would be
<module>
If you have your namespace reviewed and finalized as e.g. azure-resourcemanager-elasticsearch (com.azure.resourcemanager.elasticsearch)
, <service>
would be elasticsearch
, module
would be azure-resourcemanager-elasticsearch
.
SDK will be generated under the SDK project folder of azure-sdk-for-java
.
You can update tsp-location.yaml
under SDK project folder to track the TypeSpec project.
You can refer to the tsp-location.yaml which describes the supported properties in the file.
Here is an example.
With tsp-location.yaml
ready, run the following tsp-client
command from project directory (i.e. your current directory is <sdk-repository-dir>/sdk/<service>/<module>
) to generate the code:
Install tsp-client
CLI tool
npm install -g @azure-tools/typespec-client-generator-cli
For initial set up, from the root of the SDK repo, call
tsp-client init -c <url-to-tspconfig>
For updating TypeSpec generated SDK, call below in the SDK module folder (sdk/<service>/<module>
) where tsp-location.yaml
exists
tsp-client update
See Build.
- Frequently Asked Questions
- Azure Identity Examples
- Configuration
- Performance Tuning
- Android Support
- Unit Testing
- Test Proxy Migration
- Azure Json Migration
- New Checkstyle and Spotbugs pattern migration
- Protocol Methods
- TypeSpec-Java Quickstart
- Getting Started Guidance
- Adding a Module
- Building
- Writing Performance Tests
- Working with AutoRest
- Deprecation
- BOM guidelines
- Release process
- Access helpers