Skip to content

Commit

Permalink
Merge pull request tmenier#670 from tmenier/dev
Browse files Browse the repository at this point in the history
Flurl 3.0.4
  • Loading branch information
tmenier authored Jan 27, 2022
2 parents e39bc6a + 43817ac commit 4a65087
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<Import Project="..\PackageTester.Shared\PackageTester.Shared.projitems" />

<ItemGroup>
<PackageReference Include="Flurl.Http" Version="3.0.0" />
<PackageReference Include="Flurl.Http" Version="3.2.1" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<Import Project="..\PackageTester.Shared\PackageTester.Shared.projitems" />

<ItemGroup>
<PackageReference Include="Flurl.Http" Version="3.0.0" />
<PackageReference Include="Flurl.Http" Version="3.2.1" />
</ItemGroup>

</Project>
10 changes: 10 additions & 0 deletions Test/Flurl.Test/UrlBuilder/UrlBuildingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@ public void ignores_null_or_empty_query_params(string original) {
Assert.AreEqual(original, modified2);
}

[Test] // #669
public void can_set_query_params_using_objects_with_nullable_types() {
int? x = 1;
int? y = null;
var query = new { x, y };
var url = new Url("https://api.com");
url.SetQueryParams(query);
Assert.AreEqual("https://api.com?x=1", url.ToString());
}

[Test] // #632
public void can_set_query_params_to_enums_cast_to_ints() {
var enumValues = new[] { FileMode.Append, FileMode.Create };
Expand Down
4 changes: 2 additions & 2 deletions src/Flurl.Http/Flurl.Http.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<TargetFrameworks>netstandard2.0;net461;net472</TargetFrameworks>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<PackageId>Flurl.Http</PackageId>
<Version>3.2.1</Version>
<Version>3.2.2</Version>
<Authors>Todd Menier</Authors>
<Description>A fluent, portable, testable HTTP client library.</Description>
<PackageProjectUrl>https://flurl.dev</PackageProjectUrl>
Expand Down Expand Up @@ -34,7 +34,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="Flurl" Version="3.0.3" />
<PackageReference Include="Flurl" Version="3.0.4" />
<None Include="..\..\icon.png" Pack="true" PackagePath="\"/>
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/Flurl/Flurl.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<TargetFrameworks>netstandard2.0;net461;net472</TargetFrameworks>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<PackageId>Flurl</PackageId>
<Version>3.0.3</Version>
<Version>3.0.4</Version>
<Authors>Todd Menier</Authors>
<Description>A fluent, portable URL builder. To make HTTP calls off the fluent chain, check out Flurl.Http.</Description>
<PackageProjectUrl>https://flurl.dev</PackageProjectUrl>
Expand Down
4 changes: 4 additions & 0 deletions src/Flurl/Util/CommonExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ internal static object GetDeclaredTypeValue(object value, Type declaredType) {
if (value == null || value.GetType() == declaredType)
return value;

// without this we had https://github.com/tmenier/Flurl/issues/669
// related: https://stackoverflow.com/q/3531318/62600
declaredType = Nullable.GetUnderlyingType(declaredType) ?? declaredType;

// added to deal with https://github.com/tmenier/Flurl/issues/632
// thx @j2jensen!
if (value is IEnumerable col
Expand Down

0 comments on commit 4a65087

Please sign in to comment.