The AutoRest tool generates client libraries for accessing RESTful web services. Input to AutoRest is a spec that describes the REST API using the OpenAPI Specification format.
AutoRest is an open source tool -- if you need assistance, first check the documentation. If you find a bug or need some help, feel free to submit an issue
Start by reading the documentation for using AutoRest:
- Installing AutoRest - Shows how to install AutoRest.
- Understanding AutoRest Versions and Extensions - AutoRest core and extension versioning
- Managing AutoRest - shows how to get new updates to AutoRest and choose which version to use for code generation.
- Generating a Client using AutoRest - shows simple command line usage for generating a client library.
- Command Line Interface Documentation - explains common command line arguments.
- Examples - full, walkthrough-style scenarios for using AutoRest.
- Recent Updates - notes on recent updates .
AutoRest 3.0 introduces a large number of internal changes to support new scenarios.
AutoRest 3.0 finally supports OpenAPI3 files as an input format, with the following caveats:
- existing AutoRest v2 generators may not support all features from OpenAPI3. (see next section)
anyOf
,oneOf
are not currently supported- other OpenAPI3 specific features may not be entirely supported.
A new set of language generator plugins are being written that adopt the lighter-weight patterns for Azure Core libraries.
Existing V2 generators will default to processing with the AutoRest 2 pipeline.
If you want to force it to use the v3 (to get support for OpenAPI3 ) add --v3
to the command line:
autorest --v3 --csharp ...
Generator | Command | Notes |
---|---|---|
PowerShell | autorest --powershell ... |
Fully V3 Supported - use to generate powershell modules |
CSharp | autorest --csharp ... |
v2 generator, may use OpenAPI3 with --v3 switch (may be some differences) - v3 generator in progress |
Python | autorest --python ... |
v2 generator, may use OpenAPI3 with --v3 switch (may be some differences) - v3 generator in progress |
Java | autorest --java ... |
v2 generator, may use OpenAPI3 with --v3 switch (may be some differences) - v3 generator in progress |
TypeScript | autorest --typescript ... |
v2 generator, may use OpenAPI3 with --v3 switch (may be some differences) - v3 generator in progress |
Go | autorest --go ... |
v2 generator, may use OpenAPI3 with --v3 switch (may be some differences) - v3 generator in progress |
Ruby | autorest --ruby ... |
v2 generator - does not support v3 feature, no OpenAPI3 support |
In AutoRest v3, the pipeline has been drastically rebuilt, which allows support for:
- OpenAPI3 inputs
- Supporting merging multiple API versions
- Model Deduplication and Subset reduction across multiple API versions
- Azure Profile support (v3 generator required)
Some related information:
- Validation Rules & Linting - about the validation rules in AutoRest
- Client Runtimes - information about the client runtimes required for using code generated by AutoRest
While AutoRest itself runs on NodeJS, some generators use the .NET Core 2.0 runtime, which is the most limiting factor. See dotnet/core/release-notes/2.0/2.0-supported-os.md for a list of supported platforms.
You can now use the new Azure Functions generators to generate Function App skeleton projects from OpenAPI specs. To try it out, use one of the following generators:
Generator | Command | Notes |
---|---|---|
CSharp | autorest --azure-functions-csharp ... |
Built on --v3 work done for autorest.csharp. Supports both v2 and v3. More information on usage is available at autorest.azure-functions-csharp |
Python | autorest --azure-functions-python ... |
Built on --v3 work done for autorest.python. More information on usage is available at autorest.azure-functions-python |
Java | autorest --azure-functions-java ... |
Built on --v3 work done for autorest.java. More information on usage is available at autorest.azure-functions-java |
TypeScript | autorest --azure-functions-typescript ... |
Built on --v3 work done for autorest.typescript. More information on usage is available at autorest.azure-functions-typescript |
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.