Closed stevenvolckaert closed 5 years ago
Does this mean my package should require a package dependency to Newtonsoft.Json v11.0.0.0? Or is e.g. Version="11.*" OK? Or perhaps I can go even lower?
This is just the version which was used in the generator process, not what you actually need in your client library... should also work with newtonsoft.json v9
Thanks a lot @RicoSuter !
I'm using NSwag.MSBuild v12.3.1 swagger2csclient to generate C# clients from a Swagger v2 document, then I'm packaging the output as a NuGet package so I can use it across all projects that need to use the service the client wraps.
As explained on the SwaggerToCSharpClientGenerator wiki page, libs targeting .NET Standard 1.4+ require:
Newtonsoft.Json
System.Net.Http
System.ComponentModel.Annotations
But which versions of those NuGet packages should the client project / NuGet package depend on? I'm looking specifically for the lowest supported versions; as I need to use the client package in legacy projects and upgrading the dependencies there is difficult.
swagger2csclient
produces these lines of comments at the top of its output:Does this mean my package should require a package dependency to Newtonsoft.Json v11.0.0.0? Or is e.g.
Version="11.*"
OK? Or perhaps I can go even lower? The oldest legacy apps my client package needs to support depend on Newtonsoft.Json v10.0.2.Below my current project file of the client project. Before building the source files, it first downloads a Swagger / Open API spec from the Internet, then uses
swagger2csclient
to generateauto-generated.cs
in the project root. Note: TheKdc.*
packages are on a private NuGet feed