0

Can anyone tell me why i'm getting error when trying to consume this openAPI schema

https://sandbox.penneo.com/api/docs/swagger.json

which I need in my .NET 6 or .NET 7 C# project.

When I in Visual Studio 2022 use Connected Service to consume I get this error:

    GenerateNSwagCSharp:
1>  dotnet --roll-forward-on-no-candidate-fx 2 "C:\Users\test\.nuget\packages\nswag.msbuild\13.18.2\build\../tools/Net60//dotnet-nswag.dll" openapi2csclient /className:ClientAPI /namespace:Penneo /input:"C:\Projects\TestREST\TestREST\OpenAPIs\swagger.json" /output:"obj\swaggerClient.cs"
1>NSwag command line tool for .NET Core Net60, toolchain v13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v13.0.0.0))
1>Visit http://NSwag.org for more information.
1>NSwag bin directory: C:\Users\lol\.nuget\packages\nswag.msbuild\13.18.2\tools\Net60
1>System.InvalidOperationException: Error while rendering Liquid template CSharp/Client.Class:
1>Multiple body parameters found in operation 'casefilesPUT'.
1> ---> System.InvalidOperationException: Multiple body parameters found in operation 'casefilesPUT'.
1>   at NSwag.CodeGeneration.Models.OperationModelBase`2.get_ContentParameter() in /_/src/NSwag.CodeGeneration/Models/OperationModelBase.cs:line 188
1>   at NSwag.CodeGeneration.Models.OperationModelBase`2.get_HasContent() in /_/src/NSwag.CodeGeneration/Models/OperationModelBase.cs:line 175
1>   at Fluid.Accessors.PropertyInfoAccessor.Invoker`2.Invoke(Object target)    

When I in NSwagStudio try to consume and make a CSharp client I get this error:this:

System.InvalidOperationException: Error while rendering Liquid template CSharp/Client.Class: 
Multiple body parameters found in operation 'documentsPUT'.
 ---> System.InvalidOperationException: Multiple body parameters found in operation 'documentsPUT'.

enter image description here

Can anyone tell me how to solve this problem and how I can consume this and generate a CSharp client and models.

Thanks

Bala
  • 21
  • 4

0 Answers0