question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

C# client generator code bug

See original GitHub issue

Due to logic in /src/NSwag.CodeGeneration.CSharp/Models/CSharpClientTemplateModel.cs line 173-176

                    parameterCode = _settings.CSharpGeneratorSettings.JsonLibrary == CSharpJsonLibrary.NewtonsoftJson ?
                        "new Newtonsoft.Json.JsonSerializerSettings { Converters = " + parameterCode.Substring(2) + " }" :
                        parameterCode.Substring(2);

generated code contains

var settings = w Newtonsoft.Json.JsonSerializerSettings();

e.g. “new” substringed to __w

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
dmandreevcommented, Apr 13, 2021

After updating NJsonSchema to 10.4.1.0, and NSwag to 13.10.9.0, bug is now doesn’t reproduce.

Thank you for your support!

0reactions
RicoSutercommented, Apr 13, 2021

Is this still an issue?

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG] [C] Generating C client undefined object.h in #2338
I am trying to compile the library generated using openapi-generator with the past command, because this is what i need for my project,...
Read more >
Add C client generator
OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically ...
Read more >
Finding and Understanding Bugs in C Compilers
Every compiler we tested was found to crash and also to silently generate wrong code when presented with valid input. In this paper...
Read more >
API Code & Client Generator | Swagger Codegen
Codegen simplifies your build process by generating server stubs and client SDKs for any API defined with the OpenAPI specification. Download Codegen today....
Read more >
java - How to generated code from openapi yaml file using ...
I am using "openapi-generator-maven-plugin" to generate code from openapi yaml file and code is getting generated using below configuration ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found