[REQ][C#] use System.text.json as serializer (csharp-netcore)
Is your feature request related to a problem? Please describe.
Possible to replace the json.net newtonsoft dependency with System.text.json
Is there already anyone working on this topic?
+1
+1
+1 - is this repo dying? I see no responses from anyone. We need this too
Also hoping to see this soon
I am out of C# code base and now in Kotlin using KMM (https://kotlinlang.org) with some Swift So sorry I can not assist anymore
I have made a fork of the csharp generator with System.Text.Json. It can be found here:
https://github.com/rasmusrim/openapi-generator-csharp-system-text-json
Clone it, and then run your openapi-generator-cli command as normal, but add a -t with the path to the cloned directory. I would do something like this:
npx @openapitools/openapi-generator-cli generate -i http://localhost:5166/swagger/v1/swagger.json -g csharp -o Api.ClientSdk --library httpclient --additional-properties=packageName=Flyttavle.Plugins.PortFlowPlugin,nullableReferenceTypes=true,useDateTimeOffset=true -t ~/source/repos/openapi-generator-csharp-system-text-json
It is only tested on one of my codebases. Please raise an issue and submit a swagger file if you find some problems.
+1
Waiting for this as well
@marcselman
Check out this repo: https://github.com/rasmusrim/openapi-generator-csharp-system-text-json
This should be imported.
+1 NewtonSoft is really out-dated for years and has undocumented trouble with properties named "status" or "value" of type object !!
+1 for making it a included generator 👍
+1
+1 for supporting it in the official generator, instead of using https://github.com/rasmusrim/openapi-generator-csharp-system-text-json
fwiw i've done a ton of mods to rasmusrim's version here: https://github.com/bc3tech/openapi-generator-csharp-system-text-json/tree/mods
please file a PR to start with and then we will try to incorporate that into openapi generator
It looks like v7.12.0 could fix this? Newtonsoft.Json has been replaced by System.Text.Json internally.
+1
for using System.Text.Json!
+1