Skip to content

Commit

Permalink
It seems HttpClient is available in netstandard2.0[^1] and doesn't …
Browse files Browse the repository at this point in the history
…need to be included as a NuGet package[^2]. This PR removes the `System.Net.Http` dependency (which has a lot of dependencies itself). The tests still pass. (#221)

[^1]: [HttpClient Class (System.Net.Http) | Microsoft Learn](https://learn.microsoft.com/en-us/dotnet/api/system.net.http.httpclient?view=netstandard-2.0)
[^2]: [The State of HttpClient and .NET Multi-Targeting | leastprivilege.com](https://leastprivilege.com/2018/05/21/the-state-of-httpclient-and-net-multi-targeting/)

   > With .NET Core 2.0 and .NET Standard 2.0 you shouldn’t need to reference the SystemNetHttpClient NuGet package at all. [...] Same goes for .NET Framework: if you target 4.5 and up, you should generally use the in-box version instead of the NuGet package.
  • Loading branch information
NickDarvey authored Apr 14, 2023
1 parent 3e42d5b commit 29bd9e2
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 277 deletions.
2 changes: 0 additions & 2 deletions paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ source https://api.nuget.org/v3/index.json
frameworks: net6.0, netstandard2.0

nuget FSharp.Core
nuget System.Net.Http
nuget System.Text.Json
nuget FSharp.SystemTextJson
nuget Microsoft.OpenApi.Readers
Expand Down Expand Up @@ -40,6 +39,5 @@ group Test
nuget Microsoft.NET.Test.Sdk
nuget FsUnit.Xunit

nuget System.Net.Http
nuget Microsoft.OpenApi.Readers redirects: force
nuget FSharp.SystemTextJson
270 changes: 0 additions & 270 deletions paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,282 +7,19 @@ NUGET
System.Text.Json (>= 6.0)
Microsoft.Bcl.AsyncInterfaces (6.0) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (== netstandard2.0)
System.Threading.Tasks.Extensions (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netstandard2.1)) (== netstandard2.0)
Microsoft.NETCore.Platforms (6.0.5)
Microsoft.NETCore.Targets (5.0)
Microsoft.OpenApi (1.4.3)
Microsoft.OpenApi.Readers (1.4.1)
Microsoft.OpenApi (>= 1.4.2)
SharpYaml (>= 2.1)
NETStandard.Library.NETFramework (2.0.0-preview2-25405-01)
runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
runtime.debian.9-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
runtime.fedora.27-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
runtime.fedora.28-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
runtime.native.System (4.3.1)
Microsoft.NETCore.Platforms (>= 1.1.1)
Microsoft.NETCore.Targets (>= 1.1.3)
runtime.native.System.Net.Http (4.3.1)
Microsoft.NETCore.Platforms (>= 1.1.1)
Microsoft.NETCore.Targets (>= 1.1.3)
runtime.native.System.Security.Cryptography.Apple (4.3.1)
runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple (>= 4.3.1)
runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
runtime.debian.9-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
runtime.fedora.27-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
runtime.fedora.28-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
runtime.opensuse.42.3-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
runtime.ubuntu.18.04-x64.runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.3)
runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
runtime.opensuse.42.3-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple (4.3.1)
runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
runtime.ubuntu.18.04-x64.runtime.native.System.Security.Cryptography.OpenSsl (4.3.3)
SharpYaml (2.1)
System.Buffers (4.5.1) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (== netstandard2.0)
System.Collections (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
System.Runtime (>= 4.3)
System.Collections.Concurrent (4.3)
System.Collections (>= 4.3)
System.Diagnostics.Debug (>= 4.3)
System.Diagnostics.Tracing (>= 4.3)
System.Globalization (>= 4.3)
System.Reflection (>= 4.3)
System.Resources.ResourceManager (>= 4.3)
System.Runtime (>= 4.3)
System.Runtime.Extensions (>= 4.3)
System.Threading (>= 4.3)
System.Threading.Tasks (>= 4.3)
System.Diagnostics.Debug (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
System.Runtime (>= 4.3)
System.Diagnostics.DiagnosticSource (6.0)
System.Memory (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< net5.0)) (== netstandard2.0)
System.Runtime.CompilerServices.Unsafe (>= 6.0)
System.Diagnostics.Tracing (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
System.Runtime (>= 4.3)
System.Formats.Asn1 (6.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.0))
System.Globalization (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
System.Runtime (>= 4.3)
System.Globalization.Calendars (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
System.Globalization (>= 4.3)
System.Runtime (>= 4.3)
System.Globalization.Extensions (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
System.Globalization (>= 4.3)
System.Resources.ResourceManager (>= 4.3)
System.Runtime (>= 4.3)
System.Runtime.Extensions (>= 4.3)
System.Runtime.InteropServices (>= 4.3)
System.IO (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
System.Runtime (>= 4.3)
System.Text.Encoding (>= 4.3)
System.Threading.Tasks (>= 4.3)
System.IO.FileSystem (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
System.IO (>= 4.3)
System.IO.FileSystem.Primitives (>= 4.3)
System.Runtime (>= 4.3)
System.Runtime.Handles (>= 4.3)
System.Text.Encoding (>= 4.3)
System.Threading.Tasks (>= 4.3)
System.IO.FileSystem.Primitives (4.3)
System.Runtime (>= 4.3)
System.Linq (4.3)
System.Collections (>= 4.3)
System.Diagnostics.Debug (>= 4.3)
System.Resources.ResourceManager (>= 4.3)
System.Runtime (>= 4.3)
System.Runtime.Extensions (>= 4.3)
System.Memory (4.5.5) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (== netstandard2.0)
System.Buffers (>= 4.5.1) - restriction: || (&& (== net6.0) (>= monotouch)) (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp2.0)) (&& (== net6.0) (< netstandard1.1)) (&& (== net6.0) (< netstandard2.0)) (&& (== net6.0) (>= xamarinios)) (&& (== net6.0) (>= xamarinmac)) (&& (== net6.0) (>= xamarintvos)) (&& (== net6.0) (>= xamarinwatchos)) (== netstandard2.0)
System.Numerics.Vectors (>= 4.4) - restriction: || (&& (== net6.0) (< netcoreapp2.0)) (== netstandard2.0)
System.Runtime.CompilerServices.Unsafe (>= 4.5.3) - restriction: || (&& (== net6.0) (>= monotouch)) (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp2.0)) (&& (== net6.0) (< netcoreapp2.1)) (&& (== net6.0) (< netstandard1.1)) (&& (== net6.0) (< netstandard2.0)) (&& (== net6.0) (>= uap10.1)) (&& (== net6.0) (>= xamarinios)) (&& (== net6.0) (>= xamarinmac)) (&& (== net6.0) (>= xamarintvos)) (&& (== net6.0) (>= xamarinwatchos)) (== netstandard2.0)
System.Net.Http (4.3.4)
Microsoft.NETCore.Platforms (>= 1.1.1)
runtime.native.System (>= 4.3)
runtime.native.System.Net.Http (>= 4.3)
runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.2)
System.Collections (>= 4.3)
System.Diagnostics.Debug (>= 4.3)
System.Diagnostics.DiagnosticSource (>= 4.3)
System.Diagnostics.Tracing (>= 4.3)
System.Globalization (>= 4.3)
System.Globalization.Extensions (>= 4.3)
System.IO (>= 4.3)
System.IO.FileSystem (>= 4.3)
System.Net.Primitives (>= 4.3)
System.Resources.ResourceManager (>= 4.3)
System.Runtime (>= 4.3)
System.Runtime.Extensions (>= 4.3)
System.Runtime.Handles (>= 4.3)
System.Runtime.InteropServices (>= 4.3)
System.Security.Cryptography.Algorithms (>= 4.3)
System.Security.Cryptography.Encoding (>= 4.3)
System.Security.Cryptography.OpenSsl (>= 4.3)
System.Security.Cryptography.Primitives (>= 4.3)
System.Security.Cryptography.X509Certificates (>= 4.3)
System.Text.Encoding (>= 4.3)
System.Threading (>= 4.3)
System.Threading.Tasks (>= 4.3)
System.Net.Primitives (4.3.1)
Microsoft.NETCore.Platforms (>= 1.1.1)
Microsoft.NETCore.Targets (>= 1.1.3)
System.Runtime (>= 4.3.1)
System.Runtime.Handles (>= 4.3)
System.Numerics.Vectors (4.5) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (== netstandard2.0)
System.Reflection (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
System.IO (>= 4.3)
System.Reflection.Primitives (>= 4.3)
System.Runtime (>= 4.3)
System.Reflection.Primitives (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
System.Runtime (>= 4.3)
System.Resources.ResourceManager (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
System.Globalization (>= 4.3)
System.Reflection (>= 4.3)
System.Runtime (>= 4.3)
System.Runtime (4.3.1)
Microsoft.NETCore.Platforms (>= 1.1.1)
Microsoft.NETCore.Targets (>= 1.1.3)
System.Runtime.CompilerServices.Unsafe (6.0)
System.Runtime.Extensions (4.3.1)
Microsoft.NETCore.Platforms (>= 1.1.1)
Microsoft.NETCore.Targets (>= 1.1.3)
System.Runtime (>= 4.3.1)
System.Runtime.Handles (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
System.Runtime (>= 4.3)
System.Runtime.InteropServices (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
System.Reflection (>= 4.3)
System.Reflection.Primitives (>= 4.3)
System.Runtime (>= 4.3)
System.Runtime.Handles (>= 4.3)
System.Runtime.Numerics (4.3)
System.Globalization (>= 4.3)
System.Resources.ResourceManager (>= 4.3)
System.Runtime (>= 4.3)
System.Runtime.Extensions (>= 4.3)
System.Security.Cryptography.Algorithms (4.3.1)
Microsoft.NETCore.Platforms (>= 1.1)
runtime.native.System.Security.Cryptography.Apple (>= 4.3.1)
runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.2)
System.Collections (>= 4.3)
System.IO (>= 4.3)
System.Resources.ResourceManager (>= 4.3)
System.Runtime (>= 4.3)
System.Runtime.Extensions (>= 4.3)
System.Runtime.Handles (>= 4.3)
System.Runtime.InteropServices (>= 4.3)
System.Runtime.Numerics (>= 4.3)
System.Security.Cryptography.Encoding (>= 4.3)
System.Security.Cryptography.Primitives (>= 4.3)
System.Text.Encoding (>= 4.3)
System.Security.Cryptography.Cng (5.0)
System.Formats.Asn1 (>= 5.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.0))
System.Security.Cryptography.Csp (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
System.IO (>= 4.3)
System.Reflection (>= 4.3)
System.Resources.ResourceManager (>= 4.3)
System.Runtime (>= 4.3)
System.Runtime.Extensions (>= 4.3)
System.Runtime.Handles (>= 4.3)
System.Runtime.InteropServices (>= 4.3)
System.Security.Cryptography.Algorithms (>= 4.3)
System.Security.Cryptography.Encoding (>= 4.3)
System.Security.Cryptography.Primitives (>= 4.3)
System.Text.Encoding (>= 4.3)
System.Threading (>= 4.3)
System.Security.Cryptography.Encoding (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3)
System.Collections (>= 4.3)
System.Collections.Concurrent (>= 4.3)
System.Linq (>= 4.3)
System.Resources.ResourceManager (>= 4.3)
System.Runtime (>= 4.3)
System.Runtime.Extensions (>= 4.3)
System.Runtime.Handles (>= 4.3)
System.Runtime.InteropServices (>= 4.3)
System.Security.Cryptography.Primitives (>= 4.3)
System.Text.Encoding (>= 4.3)
System.Security.Cryptography.OpenSsl (5.0)
System.Formats.Asn1 (>= 5.0) - restriction: || (== net6.0) (&& (== netstandard2.0) (>= netcoreapp3.0))
System.Security.Cryptography.Primitives (4.3)
System.Diagnostics.Debug (>= 4.3)
System.Globalization (>= 4.3)
System.IO (>= 4.3)
System.Resources.ResourceManager (>= 4.3)
System.Runtime (>= 4.3)
System.Threading (>= 4.3)
System.Threading.Tasks (>= 4.3)
System.Security.Cryptography.X509Certificates (4.3.2)
Microsoft.NETCore.Platforms (>= 1.1)
runtime.native.System (>= 4.3)
runtime.native.System.Net.Http (>= 4.3)
runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.2)
System.Collections (>= 4.3)
System.Diagnostics.Debug (>= 4.3)
System.Globalization (>= 4.3)
System.Globalization.Calendars (>= 4.3)
System.IO (>= 4.3)
System.IO.FileSystem (>= 4.3)
System.IO.FileSystem.Primitives (>= 4.3)
System.Resources.ResourceManager (>= 4.3)
System.Runtime (>= 4.3)
System.Runtime.Extensions (>= 4.3)
System.Runtime.Handles (>= 4.3)
System.Runtime.InteropServices (>= 4.3)
System.Runtime.Numerics (>= 4.3)
System.Security.Cryptography.Algorithms (>= 4.3)
System.Security.Cryptography.Cng (>= 4.3)
System.Security.Cryptography.Csp (>= 4.3)
System.Security.Cryptography.Encoding (>= 4.3)
System.Security.Cryptography.OpenSsl (>= 4.3)
System.Security.Cryptography.Primitives (>= 4.3)
System.Text.Encoding (>= 4.3)
System.Threading (>= 4.3)
System.Text.Encoding (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
System.Runtime (>= 4.3)
System.Text.Encodings.Web (6.0)
System.Buffers (>= 4.5.1) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (== netstandard2.0)
System.Memory (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (== netstandard2.0)
Expand All @@ -295,13 +32,6 @@ NUGET
System.Runtime.CompilerServices.Unsafe (>= 6.0)
System.Text.Encodings.Web (>= 6.0)
System.Threading.Tasks.Extensions (>= 4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (== netstandard2.0)
System.Threading (4.3)
System.Runtime (>= 4.3)
System.Threading.Tasks (>= 4.3)
System.Threading.Tasks (4.3)
Microsoft.NETCore.Platforms (>= 1.1)
Microsoft.NETCore.Targets (>= 1.1)
System.Runtime (>= 4.3)
System.Threading.Tasks.Extensions (4.5.4) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp3.1)) (== netstandard2.0)
System.Runtime.CompilerServices.Unsafe (>= 4.5.3) - restriction: || (&& (== net6.0) (>= net461)) (&& (== net6.0) (< netcoreapp2.1)) (&& (== net6.0) (< netstandard1.0)) (&& (== net6.0) (< netstandard2.0)) (&& (== net6.0) (>= wp8)) (== netstandard2.0)
YamlDotNet (12.0.1)
Expand Down
1 change: 0 additions & 1 deletion src/SwaggerProvider.DesignTime/paket.references
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ File: ProvidedTypes.fs
File: Pluralizer.fs
File: NameUtils.fs

System.Net.Http
System.Text.Json
Microsoft.OpenApi.Readers

Expand Down
1 change: 0 additions & 1 deletion src/SwaggerProvider.Runtime/paket.references
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ File: ProvidedTypes.fsi
File: ProvidedTypes.fs

FSharp.Core
System.Net.Http
FSharp.SystemTextJson
1 change: 0 additions & 1 deletion src/SwaggerProvider.Runtime/paket.template
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,3 @@ references
dependencies
FSharp.Core >= LOCKEDVERSION
FSharp.SystemTextJson >= LOCKEDVERSION
System.Net.Http ~> LOCKEDVERSION
1 change: 0 additions & 1 deletion tests/SwaggerProvider.ProviderTests/paket.references
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
group Test
FSharp.Compiler.Service
FSharp.Core
System.Net.Http
Microsoft.NET.Test.Sdk
FsUnit.Xunit
1 change: 0 additions & 1 deletion tests/SwaggerProvider.Tests/paket.references
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ group Test
Microsoft.NET.Test.Sdk
FsUnit.xUnit
Microsoft.OpenApi.Readers
System.Net.Http
System.Text.Json
FSharp.SystemTextJson

0 comments on commit 29bd9e2

Please sign in to comment.