-
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.
☑️ It is recommended to configure TypeSpec package on REST API specifications. Please refer to these guidelines.
Particularly, 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
.
After configuration is completed, making a draft pull request on azure-rest-api-specs repository would automatically trigger SDK generation for all configured SDKs. The automation will create new pull request on azure-sdk-for-java repository. One can fork it for further development.
☑️ The package structure in the azure-rest-api-specs repository should follow these guidelines.
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.
Here is an example
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:
tsp-client update
☑️ tsp-client
can be installed globally via npm install -g @azure-tools/typespec-client-generator-cli
.
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