Any help would be greatly appreciated. Also, I would like to thank you in advance!

When trying to create the autorest client I am getting the following error, but I cannot figure out how to resolve it. The Web API is a 3rd party API and we cannot change it. I am trying to target net6.0.

Autorest Command:

autorest --csharp  --input-file=swagger_doc.json --namespace=MyNameSpace --output-folder=AutoRest --override-client-name=WeatherAPIClient .\custom-config.json --v3

Error Details:

info | AutoRest core version selected from configuration: ^3.2.0. info | Loading AutoRest core 'C:\Users\dfazekas.autorest@[email protected]\nodemodules@autorest\core\dist' (3.9.4) info | Loading AutoRest extension '@autorest/csharp' (latest->3.0.0-beta.20230115.1) info | Loading AutoRest extension '@autorest/modelerfour' (4.25.0->4.25.0) error | InvalidRef | Ref '#/components/schemas/Microsoft.AspNetCore.JsonPatch.Operations.Operation' is not referencing a valid location. paths,/Item/{Id},patch,requestBody,content,application/json-patch+json,schema,items - file:///C:/SHI/source/myapp/MyNameSpace.WeatherAPIClient/swagger_doc.json:1211:17

Swagger Doc from error:

"/Item/{Id}": {
     "patch": {
       "tags": [
         "Item"
       ],
       "summary": "Update one or more fields of a resource",
       "description": "Update one or more fields of a resource",
       "parameters": [
         {
           "name": "Id",
           "in": "path",
           "required": true,
           "schema": {
             "type": "integer",
             "format": "int32"
           }
         }
       ],
       "requestBody": {
         "content": {
           "application/json-patch+json": {
             "schema": {
               "type": "array",
               "items": {
                 "$ref": "#/components/schemas/Microsoft.AspNetCore.JsonPatch.Operations.Operation"
               }
             }
           },
           "application/json": {
             "schema": {
               "type": "array",
               "items": {
                 "$ref": "#/components/schemas/Microsoft.AspNetCore.JsonPatch.Operations.Operation"
               }
             }
           }
         },
         "required": true
       },
       "responses": {
         "200": {
           "description": "Success"
         },
         "400": {
           "description": "Bad Request",
           "content": {
             "application/json": {
               "schema": {
                 "$ref": "#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails"
               }
             }
           }
         },
         "500": {
           "description": "Server Error"
         }
       }
     }
   },
0

There are 0 best solutions below