-
Notifications
You must be signed in to change notification settings - Fork 572
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable test for JSON<->property name consistency (#1804)
- Loading branch information
Showing
7 changed files
with
47 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace Stripe.Infrastructure | ||
{ | ||
using Newtonsoft.Json; | ||
|
||
/// <summary> | ||
/// Used to indicate that a particular property is allowed to have a name that isn't a strict | ||
/// <c>snake_case</c> -> <c>CamelCase</c> conversion from the JSON name defined its | ||
/// <see cref="JsonPropertyAttribute" /> property. | ||
/// </summary> | ||
/// <remarks> | ||
/// This is only used for an internal wholesome test. | ||
/// </remarks> | ||
[System.AttributeUsage(System.AttributeTargets.Property)] | ||
internal class AllowNameMismatch : System.Attribute | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 5 additions & 1 deletion
6
src/Stripe.net/Services/TaxRates/TaxRatePercentageRangeOptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,24 @@ | ||
namespace Stripe | ||
{ | ||
using System; | ||
using Newtonsoft.Json; | ||
using Stripe.Infrastructure; | ||
|
||
public class TaxRatePercentageRangeOptions : INestedOptions | ||
{ | ||
[JsonProperty("gt")] | ||
[AllowNameMismatch] | ||
public decimal? GreaterThan { get; set; } | ||
|
||
[JsonProperty("gte")] | ||
[AllowNameMismatch] | ||
public decimal? GreaterThanOrEqual { get; set; } | ||
|
||
[JsonProperty("lt")] | ||
[AllowNameMismatch] | ||
public decimal? LessThan { get; set; } | ||
|
||
[JsonProperty("lte")] | ||
[AllowNameMismatch] | ||
public decimal? LessThanOrEqual { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters