Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AutoTask.Psa.Api/AutoTask.Psa.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
<PackageReference Include="Refit" Version="8.0.0" />
<PackageReference Include="Refit" Version="10.0.1" />
<PackageReference Include="Roslynator.Analyzers" Version="4.14.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
21 changes: 9 additions & 12 deletions AutoTask.Psa.Api/AutoTaskClient.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using Newtonsoft.Json.Linq;
using System.Text;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace AutoTask.Psa.Api;

Expand Down Expand Up @@ -27,18 +29,13 @@ public AutoTaskClient(HttpClient client)
_httpClient = client;
_refitSettings = new RefitSettings
{
//ContentSerializer = new NewtonsoftJsonContentSerializer(
// new JsonSerializerSettings
// {
// // By default nulls should not be rendered out, this will allow the receiving API to apply any defaults.
// // Use [JsonProperty(NullValueHandling = NullValueHandling.Include)] to send
// // nulls for specific properties, e.g. disassociating port schedule ids from a port
// NullValueHandling = NullValueHandling.Ignore,
// #if DEBUG
// MissingMemberHandling = MissingMemberHandling.Error,
// #endif
// Converters = new List<JsonConverter> { new StringEnumConverter() }
// })
ContentSerializer = new SystemTextJsonContentSerializer(
new JsonSerializerOptions
{
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
WriteIndented = true,
})
};
ActionTypes = RefitFor(ActionTypes!);
AdditionalInvoiceFieldValues = RefitFor(AdditionalInvoiceFieldValues!);
Expand Down