Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update converter references to resolve enum values #91

Merged
merged 1 commit into from
Jun 12, 2024
Merged
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
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,10 @@ Added custom converter to fallback to default unspecified error code if value ca

### Changed

Updated to .NET 8.0, removed Newtonsoft.Json dependency, and updated to System.Text.Json
Updated to .NET 8.0, removed Newtonsoft.Json dependency, and updated to System.Text.Json

## 2.0.1

### Changed

Updated references to use proper converter to resolve enum string values
2 changes: 1 addition & 1 deletion ShipEngine/Models/Dto/Common/Address.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class Address
/// <summary>
/// Indicates whether the address is residential or commercial, if known.
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public AddressResidentialIndicator? AddressResidentialIndicator { get; set; }
}
}
4 changes: 2 additions & 2 deletions ShipEngine/Models/Dto/Common/AdvancedShipmentOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class AdvancedShipmentOptions
/// Indicates whether to bill shipping costs to the recipient or to a third-party.
/// When billing to a third-party, the bill_to_account, bill_to_country_code, and bill_to_postal_code fields must also be set.
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public BillToParty? BillToParty { get; set; }

/// <summary>
Expand Down Expand Up @@ -96,7 +96,7 @@ public class AdvancedShipmentOptions
/// <summary>
/// Indicates if the package will be picked up or dropped off by the carrier
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public OriginType? OriginType { get; set; }

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion ShipEngine/Models/Dto/Common/CollectOnDelivery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class CollectOnDelivery
/// <summary>
/// Types of payment that are supported
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public PaymentType? PaymentType { get; set; }

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion ShipEngine/Models/Dto/Common/Customs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
/// <summary>
/// The type of contents in this shipment. This may impact import duties or customs treatment.
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public PackageContents Contents { get; set; }

/// <summary>
Expand All @@ -24,7 +24,7 @@
/// <summary>
/// Customs declarations for each item in the shipment.
/// </summary>
public List<CustomsItem> CustomsItems { get; set; }

Check warning on line 27 in ShipEngine/Models/Dto/Common/Customs.cs

View workflow job for this annotation

GitHub Actions / .Net 8.0 on ubuntu-latest

Non-nullable property 'CustomsItems' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 27 in ShipEngine/Models/Dto/Common/Customs.cs

View workflow job for this annotation

GitHub Actions / .Net 8.0 on windows-latest

Non-nullable property 'CustomsItems' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.

Check warning on line 27 in ShipEngine/Models/Dto/Common/Customs.cs

View workflow job for this annotation

GitHub Actions / .Net 8.0 on windows-latest

Non-nullable property 'CustomsItems' must contain a non-null value when exiting constructor. Consider declaring the property as nullable.
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion ShipEngine/Models/Dto/Common/ShipmentItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class ShipmentItem
/// <summary>
/// The order sources that are supported by ShipEngine
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public OrderSourceCode? OrderSourceCode { get; set; }
}
}
6 changes: 3 additions & 3 deletions ShipEngine/Models/Dto/CreateLabelFromRate/Params.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ public class Params
/// <summary>
/// The layout (size) that you want the label to be in.
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public LabelLayout LabelLayout { get; set; }

/// <summary>
/// The file format that you want the label to be in.
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public LabelFormat LabelFormat { get; set; }

/// <summary>
Expand All @@ -41,7 +41,7 @@ public class Params
/// <summary>
/// The display format that the label should be shown in.
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public DisplayScheme DisplayScheme { get; set; }
}
}
12 changes: 6 additions & 6 deletions ShipEngine/Models/Dto/CreateLabelFromShipmentDetails/Params.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class Params
/// <summary>
/// The label charge event.
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public ChargeEvent? ChargeEvent { get; set; }

/// <summary>
Expand Down Expand Up @@ -155,19 +155,19 @@ public class Shipment
/// <summary>
/// Indicates if the package will be picked up or dropped off by the carrier
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public OriginType OriginType { get; set; }

/// <summary>
/// The insurance provider to use for any insured packages in the shipment
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public InsuranceProvider InsuranceProvider { get; set; }

/// <summary>
/// The order sources that are supported by ShipEngine
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public OrderSourceCode? OrderSourceCode { get; set; }

/// <summary>
Expand Down Expand Up @@ -222,13 +222,13 @@ public class InternationalShipmentOptions
/// <summary>
/// The type of contents in this shipment. This may impact import duties or customs treatment.
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public PackageContents Contents { get; set; }

/// <summary>
/// Indicates what to do if a package is unable to be delivered.
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public NonDelivery NonDelivery { get; set; }

/// <summary>
Expand Down
6 changes: 3 additions & 3 deletions ShipEngine/Models/Dto/GetRatesFromShipmentDetails/Params.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public class Shipment
/// <summary>
/// The type of delivery confirmation that is required for this shipment.
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public DeliveryConfirmation Confirmation { get; set; }

/// <summary>
Expand All @@ -121,7 +121,7 @@ public class Shipment
/// <summary>
/// The insurance provider to use for any insured packages in the shipment.
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public InsuranceProvider InsuranceProvider { get; set; }

/// <summary>
Expand All @@ -132,7 +132,7 @@ public class Shipment
/// <summary>
/// The order sources that are supported by ShipEngine
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public OrderSourceCode OrderSourceCode { get; set; }

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion ShipEngine/ShipEngine.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<PackageId>ShipEngine</PackageId>
<PackageTags>sdk;rest;api;shipping;rates;label;tracking;cost;address;validation;normalization;fedex;ups;usps;</PackageTags>

<Version>2.0.0</Version>
<Version>2.0.1</Version>
<Authors>ShipEngine</Authors>
<Company>ShipEngine</Company>
<Summary>The official ShipEngine C# SDK for .NET</Summary>
Expand Down
Loading