-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Working with AutoRest
Srikanta edited this page Jun 25, 2020
·
8 revisions
AutoRest is the name of the tool we use to generate the communication layer that lies beneath the API we expose to our users. AutoRest saves us from having to write a lot of network communication code, and instead we can direct our focus towards building a great user experience on top of this generated code. Our goal should be to expose as little, and ideally none, of the generated code to the user.
Getting started with AutoRest is as simple as following these steps:
- Fork and clone this GitHub repo and switch to the "v4" branch.
git clone https://github.com/Azure/autorest.java.git
git checkout v4
- Build the package using Maven
mvn clean package -Dlocal
- Run
npm install
. You need v10 version of Node.JS installed. - Run
npm install -g autorest
. - Run AutoRest commands like this:
autorest --java --use=C:\work\autorest.java\ C:\swagger\updated\Blob\readme.md --output-folder=C:\work\azure-sdk-for-java\storage\client\ --namespace=com.azure.storage.blob --sync-methods=none --generate-client-interfaces=false --enable-xml --required-parameter-client-methods
Notes:
--use=<path to your autorest.java clone>
- If the input is a JSON spec, use
--input-file=<local path of URL of JSON file>
, if it's a README.md file, remove--input-file=
-
--enable-xml --required-parameter-client-methods
are not needed for services other than Storage
- 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