The AutoRest tool generates client libraries for accessing RESTful web services. Input to AutoRest is a spec that describes the REST API using the Swagger format.
Questions tagged [autorest]
123 questions
29
votes
7 answers
ExperimentalWarning: The fs.promises API is experimental
I am new to node and npm and trying to understand AutoRest.
When I type
autorest --list-available
into powershell ISE
I get
AutoRest code generation utility [version: 2.0.4262; node: v10.1.0]
(C) 2018 Microsoft…

Kirsten
- 15,730
- 41
- 179
- 318
8
votes
4 answers
Autorest + Swagger does not generate ENUMs properly
I have two applications A and B. On A I use swagger for describing an API. On A I have also the definitions of classes with some enums properties.
I want to generate a client API on B. For this I use Autorest. Everything works fine except one thing…

Kool
- 323
- 1
- 3
- 10
7
votes
2 answers
Error compiling Autorest Generated Client
After autogenerating client using Swagger OpenApi 3.0 spec, I'm unable to compile the generated client. I get error on objects ClientDiagnostics, RawRequestUriBuilder, Utf8JsonRequestContent.
RestClient.cs
// Copyright (c) Microsoft Corporation. All…

user15343622
- 73
- 1
- 3
7
votes
1 answer
Autorest error - swagger.json' is not a valid OpenAPI 2.0 definition (expected 'swagger: 2.0')
My api is running net core 3.0 with Swashbuckle.AspNetCore 5.0.0-rc5
When I run autorest on my generated swagger.json file I get:
swagger.json is not a valid OpenAPI 2.0 definition (expected 'swagger: 2.0')
My swagger.json file does indeed say…

levis84
- 974
- 1
- 12
- 27
7
votes
3 answers
Why does Visual Studio 2017 fail to generate REST API client for Swagger Petstore?
I'm playing around with using Swagger / OpenAPI docs/specs to generate REST API client code in C#, but I'm running into several problems.
Most notably - when trying to use the Swagger.io Petstore example as a starting point:
Using the VS 2017 Add >…

marc_s
- 732,580
- 175
- 1,330
- 1,459
7
votes
3 answers
Should we use Singletons for clients derived from Microsoft.Rest.ServiceClient in C#?
When working with Azure .NET SDKs generated from swagger specs (such as those associated with Azure Resource Manager) the resulting libraries leverage the Microsoft AutoRest Client Runtime and the various "Clients" all inherit from "ServiceClient".…

solvingJ
- 1,321
- 1
- 19
- 30
6
votes
0 answers
How can a service transfer a generic JsonPatchDocument<> to another service?
I have built an application running on Azure (ASP.Net Core 2.1) that involves microservices and a client application:
Client app (Android) --calls--> microservice A (gateway) --forwards->
microservice B
In the microservice B, I have the…

Kzryzstof
- 7,688
- 10
- 61
- 108
6
votes
3 answers
How can I use Windows Authentication with Microsoft.Rest.ServiceClient
I have a Microsoft.Rest.ServiceClient generated with autorest. And I want to access a REST API secured with Windows Authentication and Basic Authentication.
The goal is to use Windows Authentication. I tried it as follows:
var handler = new…

Heiner
- 1,869
- 1
- 19
- 33
6
votes
1 answer
How to update AutoRest in visual studio 2017
Context
I would like to use AutoRest generated client for a webapi service by using "Add"/"REST API Client..." in visual studio 2017.
However, it gives the following error:
[Info]AutoRest Core 0.16.0.0
...
[Fatal]Error generating client model:…

ld dl
- 61
- 4
5
votes
2 answers
MSB3037 openapi2csclient exited with code -1
I used Visual Studio Add-Service-Reference to add a service that uses the OpenAPI Specification.
I input the swagger URL and generated the code.
The .csproj indicates that the service is configured.
However when I try to build I get an error.
The…

Kirsten
- 15,730
- 41
- 179
- 318
5
votes
1 answer
Reference Includes source that is not in the repository
I have cloned the code for autorest.csharp and it's submodules
However test project has a missing dependency
The build error is
Error CS0234 The type or namespace name 'Modeler'
does not exist in the namespace 'AutoRest'
(are you missing an…

Kirsten
- 15,730
- 41
- 179
- 318
5
votes
3 answers
Autorest fails to generate anything, and no error
I am trying the petshop client generation example on github and autorest just exits without creating anything or throwing any errors. Autorest behaves like I did not pass any arguments. Attached is a screenshot of my powershell execution.

busbina
- 549
- 1
- 7
- 19
5
votes
0 answers
How to update generated AutoRest code, after server REST API changed?
Context
I am writing client code to access Web API REST service. I am using typed client classes by using Visual Studio 2015 "Add"/"REST API client..."
Now the serverside API changed and I would like to update my generated client code…

g.pickardou
- 32,346
- 36
- 123
- 268
4
votes
1 answer
AutoRest generates the client ctor as internal + ignores the credentials flag
I am generating a C# REST service client via AutoRest (OpenAPI v3).
I'm generating the client by running the following command:
autorest --input-file="./Resources/swagger.json" --output-folder="./SomeService/Generated"…

DavisZ
- 141
- 9
4
votes
1 answer
swagger-document-override/md-override-loader - FAILED
I am able to generate code using Autorest with my api when I host it on a server 2012R2 running IIS
However when I try to run it with the localhost url I get a could not read message.
I can read swagger.json in the browser
I am using the…

Kirsten
- 15,730
- 41
- 179
- 318