autorest

Create one code client / flatten controllers with NSwag and AutoREST

巧了我就是萌 提交于 2021-02-08 10:55:49
问题 I'm trying to create a code wrapper for an api with NSwag and Autorest. Previously I was using Swashbuckle to generate the swagger file. It generated the swagger file with operationIds in the format actionMethod . This resulted in Autorest generating a code client that was 1-deep. All of the actions were on the top-level class. For various reasons, I needed to change swagger generation to NSwag. This generates operationIds in the format controller_actionMethod . This results in AutoRest

Autorest error - swagger.json' is not a valid OpenAPI 2.0 definition (expected 'swagger: 2.0')

时光总嘲笑我的痴心妄想 提交于 2020-05-23 13:54:25
问题 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 "openapi": "3.0.1". It used to be v2.0 but since I upgraded to net core 3.0 I had to upgrade Swashbuckle which now creates the json file with v3.0.1 I ran "choco install autorest" so I should be running the latest version If autorest doesn't support

Autorest Failed resolving swagger.json against file when swagger.json is served by localhost

冷暖自知 提交于 2020-05-07 08:16:24
问题 I am able to use Autorest_core 3 to generate the client when swagger.json is hosted on a website but not when it is hosted on localhost. However if I cut and paste the swagger.json from local host into a file then I can generate the client. In startup.ConfigureServices I have services.AddSwaggerGen(c => { c.SwaggerDoc("v1", new OpenApiInfo { Title = "My API", Version = "v1" }); c.CustomOperationIds( d => (d.ActionDescriptor as ControllerActionDescriptor)?.ActionName); And in Startup.Configure

Note: AutoRest core version selected from configuration: ~2.0.4413 when I have installed 3.06187

人走茶凉 提交于 2020-04-18 03:47:53
问题 I have installed autorest 3.0.3187 on node v12.16.1 and I ran autorest --reset to remove old versions However when I run autorest --input-file=https://myapplication/mydocs/v1/swagger.json --output-folder=generated --csharp --namespace=MyNameSpace I get the following output NOTE: AutoRest core version selected from configuration: ~2.0.4413. Loading AutoRest core 'C:\Users\kirst\.autorest\@microsoft.azure_autorest- core@2.0.4417\node_modules\@microsoft.azure\autorest-core\dist' (2.0.4417)

FATAL: OperationId is required for all operations. Please add it for 'get' operation of path

余生长醉 提交于 2020-04-18 03:47:31
问题 I am using AutoRest to generate the client side of an api from swagger.json The output is AutoRest code generation utility [cli version: 3.0.6187; node: v10.16.3, max-memory: 8192 gb] (C) 2018 Microsoft Corporation. https://aka.ms/autorest NOTE: AutoRest core version selected from configuration: ~2.0.4413. Loading AutoRest core 'C:\Users\kirst\.autorest\@microsoft.azure_autorest-core@2.0.4417\node_modules\@microsoft.azure\autorest-core\dist' (2.0.4417) Loading AutoRest extension '@microsoft

FATAL: OperationId is required for all operations. Please add it for 'get' operation of path

末鹿安然 提交于 2020-04-18 03:47:27
问题 I am using AutoRest to generate the client side of an api from swagger.json The output is AutoRest code generation utility [cli version: 3.0.6187; node: v10.16.3, max-memory: 8192 gb] (C) 2018 Microsoft Corporation. https://aka.ms/autorest NOTE: AutoRest core version selected from configuration: ~2.0.4413. Loading AutoRest core 'C:\Users\kirst\.autorest\@microsoft.azure_autorest-core@2.0.4417\node_modules\@microsoft.azure\autorest-core\dist' (2.0.4417) Loading AutoRest extension '@microsoft