/autorest

OpenAPI (f.k.a Swagger) Specification code generator. Supports C#, PowerShell, Go, Java, Node.js, TypeScript, Python, Ruby

Primary LanguageTypeScriptMIT LicenseMIT

AutoRest

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.

Support Policy

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

Getting Started using AutoRest image

Start by reading the documentation for using AutoRest:

New! AutoRest Version 3.0

AutoRest 3.0 introduces a large number of internal changes to support new scenarios.

Features

OpenAPI3 support!

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.

Generators

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

New V3 Pipeline

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:

Supported Platforms

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.

Preview features

Server-side code generation for Azure Functions

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

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.