Skip to content

Commit 3e78df8

Browse files
committed
fix: scope the System.Text.Json reference to netstandard2.0, name the failing member
Two issues from review: - System.Text.Json was referenced unconditionally, pushing a dependency constraint onto net8.0+ consumers that already have it in-box. Now conditioned on netstandard2.0, which is the target that actually needs it. netstandard2.0 still resolves 9.0.9, so there is no NU1605 downgrade. - Argument validation reported nameof(request) when it was request.Text that was empty, pointing callers at the wrong member.
1 parent 7d31c1b commit 3e78df8

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

Spice/Spice.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@
5656
</ItemGroup>
5757

5858
<!--
59-
System.Text.Json arrives transitively via Apache.Arrow.Adbc, but search
60-
serialization depends on it directly, so pin it explicitly. The version matches
61-
what Apache.Arrow.Adbc already resolves to; netstandard2.0 needs the package
62-
because, unlike net8.0+, it has no in-box System.Text.Json.
59+
netstandard2.0 has no in-box System.Text.Json, so it needs the package. net8.0+
60+
ship it in the framework, and referencing it there would push an unnecessary
61+
dependency constraint onto consumers. The version matches what
62+
Apache.Arrow.Adbc already resolves to, so netstandard2.0 sees no downgrade.
6363
-->
64-
<ItemGroup>
64+
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
6565
<PackageReference Include="System.Text.Json" Version="9.0.9" />
6666
</ItemGroup>
6767

Spice/src/Http/SpiceHttpClient.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,11 @@ public async Task<SearchResponse> SearchAsync(SearchRequest request, Cancellatio
160160
#if NET8_0_OR_GREATER
161161
ObjectDisposedException.ThrowIf(_disposed, this);
162162
ArgumentNullException.ThrowIfNull(request);
163-
ArgumentException.ThrowIfNullOrWhiteSpace(request.Text, nameof(request));
163+
ArgumentException.ThrowIfNullOrWhiteSpace(request.Text, $"{nameof(request)}.{nameof(request.Text)}");
164164
#else
165165
if (_disposed) throw new ObjectDisposedException(GetType().FullName);
166166
ThrowHelper.ThrowIfNull(request, nameof(request));
167-
ThrowHelper.ThrowIfNullOrWhiteSpace(request.Text, nameof(request));
167+
ThrowHelper.ThrowIfNullOrWhiteSpace(request.Text, $"{nameof(request)}.{nameof(request.Text)}");
168168
#endif
169169

170170
var url = $"{_httpAddress}/v1/search";

0 commit comments

Comments
 (0)