Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,12 @@
{{^isMap}}
{{^isEnum}}
{{^isUuid}}
{{#isDecimal}}
{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetDecimal());
{{/isDecimal}}
{{^isDecimal}}
{{#lambda.camelcase_sanitize_param}}{{name}}{{/lambda.camelcase_sanitize_param}} = {{>OptionProperty}}utf8JsonReader.GetString(){{^isNullable}}{{nrt!}}{{/isNullable}});
{{/isDecimal}}
{{/isUuid}}
{{/isEnum}}
{{/isMap}}
Expand Down Expand Up @@ -450,7 +455,12 @@
{{^isEnum}}
{{^isUuid}}
{{#lambda.copyText}}
{{#isDecimal}}
writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}}.ToString());
{{/isDecimal}}
{{^isDecimal}}
writer.WriteString("{{baseName}}", {{#lambda.camelcase_sanitize_param}}{{classname}}{{/lambda.camelcase_sanitize_param}}.{{name}});
{{/isDecimal}}
{{/lambda.copyText}}
{{#lambda.indent3}}
{{>WriteProperty}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1673,6 +1673,7 @@ components:
- byte
- date
- password
- string_formatted_as_decimal_required
properties:
integer:
type: integer
Expand Down Expand Up @@ -1771,6 +1772,12 @@ components:
description: None
type: string
pattern: '^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$'
string_formatted_as_decimal:
format: decimal
type: string
string_formatted_as_decimal_required:
format: decimal
type: string
EnumClass:
type: string
default: '-efg'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1665,11 +1665,18 @@ components:
pattern: "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\\
/([0-9]|[1-2][0-9]|3[0-2]))$"
type: string
string_formatted_as_decimal:
format: decimal
type: string
string_formatted_as_decimal_required:
format: decimal
type: string
required:
- byte
- date
- number
- password
- string_formatted_as_decimal_required
type: object
EnumClass:
default: -efg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Name | Type | Description | Notes
**Date** | **DateTime** | |
**Number** | **decimal** | |
**Password** | **string** | |
**StringFormattedAsDecimalRequired** | **decimal** | |
**Binary** | **System.IO.Stream** | | [optional]
**DateTime** | **DateTime** | | [optional]
**Decimal** | **decimal** | | [optional]
Expand All @@ -25,6 +26,7 @@ Name | Type | Description | Notes
**PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional]
**PatternWithDigitsAndDelimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional]
**String** | **string** | | [optional]
**StringFormattedAsDecimal** | **decimal** | | [optional]
**UnsignedInteger** | **uint** | | [optional]
**UnsignedLong** | **ulong** | | [optional]
**Uuid** | **Guid** | | [optional]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ public void PasswordTest()
// TODO unit test for the property 'Password'
}

/// <summary>
/// Test the property 'StringFormattedAsDecimalRequired'
/// </summary>
[Fact]
public void StringFormattedAsDecimalRequiredTest()
{
// TODO unit test for the property 'StringFormattedAsDecimalRequired'
}

/// <summary>
/// Test the property 'Binary'
/// </summary>
Expand Down Expand Up @@ -242,6 +251,15 @@ public void StringTest()
// TODO unit test for the property 'String'
}

/// <summary>
/// Test the property 'StringFormattedAsDecimal'
/// </summary>
[Fact]
public void StringFormattedAsDecimalTest()
{
// TODO unit test for the property 'StringFormattedAsDecimal'
}

/// <summary>
/// Test the property 'UnsignedInteger'
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public partial class FormatTest : IValidatableObject
/// <param name="date">date</param>
/// <param name="number">number</param>
/// <param name="password">password</param>
/// <param name="stringFormattedAsDecimalRequired">stringFormattedAsDecimalRequired</param>
/// <param name="binary">binary</param>
/// <param name="dateTime">dateTime</param>
/// <param name="decimal">decimal</param>
Expand All @@ -53,16 +54,18 @@ public partial class FormatTest : IValidatableObject
/// <param name="patternWithDigits">A string that is a 10 digit number. Can have leading zeros.</param>
/// <param name="patternWithDigitsAndDelimiter">A string starting with &#39;image_&#39; (case insensitive) and one to three digits following i.e. Image_01.</param>
/// <param name="string">string</param>
/// <param name="stringFormattedAsDecimal">stringFormattedAsDecimal</param>
/// <param name="unsignedInteger">unsignedInteger</param>
/// <param name="unsignedLong">unsignedLong</param>
/// <param name="uuid">uuid</param>
[JsonConstructor]
public FormatTest(byte[] @byte, DateTime date, decimal number, string password, Option<System.IO.Stream> binary = default, Option<DateTime?> dateTime = default, Option<decimal?> @decimal = default, Option<double?> @double = default, Option<float?> @float = default, Option<int?> int32 = default, Option<int?> int32Range = default, Option<long?> int64 = default, Option<long?> int64Negative = default, Option<long?> int64NegativeExclusive = default, Option<long?> int64Positive = default, Option<long?> int64PositiveExclusive = default, Option<int?> integer = default, Option<string> patternWithBackslash = default, Option<string> patternWithDigits = default, Option<string> patternWithDigitsAndDelimiter = default, Option<string> @string = default, Option<uint?> unsignedInteger = default, Option<ulong?> unsignedLong = default, Option<Guid?> uuid = default)
public FormatTest(byte[] @byte, DateTime date, decimal number, string password, decimal stringFormattedAsDecimalRequired, Option<System.IO.Stream> binary = default, Option<DateTime?> dateTime = default, Option<decimal?> @decimal = default, Option<double?> @double = default, Option<float?> @float = default, Option<int?> int32 = default, Option<int?> int32Range = default, Option<long?> int64 = default, Option<long?> int64Negative = default, Option<long?> int64NegativeExclusive = default, Option<long?> int64Positive = default, Option<long?> int64PositiveExclusive = default, Option<int?> integer = default, Option<string> patternWithBackslash = default, Option<string> patternWithDigits = default, Option<string> patternWithDigitsAndDelimiter = default, Option<string> @string = default, Option<decimal?> stringFormattedAsDecimal = default, Option<uint?> unsignedInteger = default, Option<ulong?> unsignedLong = default, Option<Guid?> uuid = default)
{
Byte = @byte;
Date = date;
Number = number;
Password = password;
StringFormattedAsDecimalRequired = stringFormattedAsDecimalRequired;
BinaryOption = binary;
DateTimeOption = dateTime;
DecimalOption = @decimal;
Expand All @@ -80,6 +83,7 @@ public FormatTest(byte[] @byte, DateTime date, decimal number, string password,
PatternWithDigitsOption = patternWithDigits;
PatternWithDigitsAndDelimiterOption = patternWithDigitsAndDelimiter;
StringOption = @string;
StringFormattedAsDecimalOption = stringFormattedAsDecimal;
UnsignedIntegerOption = unsignedInteger;
UnsignedLongOption = unsignedLong;
UuidOption = uuid;
Expand Down Expand Up @@ -113,6 +117,12 @@ public FormatTest(byte[] @byte, DateTime date, decimal number, string password,
[JsonPropertyName("password")]
public string Password { get; set; }

/// <summary>
/// Gets or Sets StringFormattedAsDecimalRequired
/// </summary>
[JsonPropertyName("string_formatted_as_decimal_required")]
public decimal StringFormattedAsDecimalRequired { get; set; }

/// <summary>
/// Used to track the state of Binary
/// </summary>
Expand Down Expand Up @@ -338,6 +348,19 @@ public FormatTest(byte[] @byte, DateTime date, decimal number, string password,
[JsonPropertyName("string")]
public string String { get { return this.StringOption; } set { this.StringOption = new Option<string>(value); } }

/// <summary>
/// Used to track the state of StringFormattedAsDecimal
/// </summary>
[JsonIgnore]
[global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)]
public Option<decimal?> StringFormattedAsDecimalOption { get; private set; }

/// <summary>
/// Gets or Sets StringFormattedAsDecimal
/// </summary>
[JsonPropertyName("string_formatted_as_decimal")]
public decimal? StringFormattedAsDecimal { get { return this.StringFormattedAsDecimalOption; } set { this.StringFormattedAsDecimalOption = new Option<decimal?>(value); } }

/// <summary>
/// Used to track the state of UnsignedInteger
/// </summary>
Expand Down Expand Up @@ -396,6 +419,7 @@ public override string ToString()
sb.Append(" Date: ").Append(Date).Append("\n");
sb.Append(" Number: ").Append(Number).Append("\n");
sb.Append(" Password: ").Append(Password).Append("\n");
sb.Append(" StringFormattedAsDecimalRequired: ").Append(StringFormattedAsDecimalRequired).Append("\n");
sb.Append(" Binary: ").Append(Binary).Append("\n");
sb.Append(" DateTime: ").Append(DateTime).Append("\n");
sb.Append(" Decimal: ").Append(Decimal).Append("\n");
Expand All @@ -413,6 +437,7 @@ public override string ToString()
sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n");
sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n");
sb.Append(" String: ").Append(String).Append("\n");
sb.Append(" StringFormattedAsDecimal: ").Append(StringFormattedAsDecimal).Append("\n");
sb.Append(" UnsignedInteger: ").Append(UnsignedInteger).Append("\n");
sb.Append(" UnsignedLong: ").Append(UnsignedLong).Append("\n");
sb.Append(" Uuid: ").Append(Uuid).Append("\n");
Expand Down Expand Up @@ -628,6 +653,7 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo
Option<DateTime?> date = default;
Option<decimal?> number = default;
Option<string> password = default;
Option<decimal?> stringFormattedAsDecimalRequired = default;
Option<System.IO.Stream> binary = default;
Option<DateTime?> dateTime = default;
Option<decimal?> varDecimal = default;
Expand All @@ -645,6 +671,7 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo
Option<string> patternWithDigits = default;
Option<string> patternWithDigitsAndDelimiter = default;
Option<string> varString = default;
Option<decimal?> stringFormattedAsDecimal = default;
Option<uint?> unsignedInteger = default;
Option<ulong?> unsignedLong = default;
Option<Guid?> uuid = default;
Expand Down Expand Up @@ -679,6 +706,9 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo
case "password":
password = new Option<string>(utf8JsonReader.GetString());
break;
case "string_formatted_as_decimal_required":
stringFormattedAsDecimalRequired = new Option<decimal?>(utf8JsonReader.GetDecimal());
break;
case "binary":
if (utf8JsonReader.TokenType != JsonTokenType.Null)
binary = new Option<System.IO.Stream>(JsonSerializer.Deserialize<System.IO.Stream>(ref utf8JsonReader, jsonSerializerOptions));
Expand Down Expand Up @@ -743,6 +773,9 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo
case "string":
varString = new Option<string>(utf8JsonReader.GetString());
break;
case "string_formatted_as_decimal":
stringFormattedAsDecimal = new Option<decimal?>(utf8JsonReader.GetDecimal());
break;
case "unsigned_integer":
if (utf8JsonReader.TokenType != JsonTokenType.Null)
unsignedInteger = new Option<uint?>(utf8JsonReader.GetUInt32());
Expand Down Expand Up @@ -773,6 +806,9 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo
if (!password.IsSet)
throw new ArgumentException("Property is required for class FormatTest.", nameof(password));

if (!stringFormattedAsDecimalRequired.IsSet)
throw new ArgumentException("Property is required for class FormatTest.", nameof(stringFormattedAsDecimalRequired));

if (varByte.IsSet && varByte.Value == null)
throw new ArgumentNullException(nameof(varByte), "Property is not nullable for class FormatTest.");

Expand All @@ -785,6 +821,9 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo
if (password.IsSet && password.Value == null)
throw new ArgumentNullException(nameof(password), "Property is not nullable for class FormatTest.");

if (stringFormattedAsDecimalRequired.IsSet && stringFormattedAsDecimalRequired.Value == null)
throw new ArgumentNullException(nameof(stringFormattedAsDecimalRequired), "Property is not nullable for class FormatTest.");

if (binary.IsSet && binary.Value == null)
throw new ArgumentNullException(nameof(binary), "Property is not nullable for class FormatTest.");

Expand Down Expand Up @@ -836,6 +875,9 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo
if (varString.IsSet && varString.Value == null)
throw new ArgumentNullException(nameof(varString), "Property is not nullable for class FormatTest.");

if (stringFormattedAsDecimal.IsSet && stringFormattedAsDecimal.Value == null)
throw new ArgumentNullException(nameof(stringFormattedAsDecimal), "Property is not nullable for class FormatTest.");

if (unsignedInteger.IsSet && unsignedInteger.Value == null)
throw new ArgumentNullException(nameof(unsignedInteger), "Property is not nullable for class FormatTest.");

Expand All @@ -845,7 +887,7 @@ public override FormatTest Read(ref Utf8JsonReader utf8JsonReader, Type typeToCo
if (uuid.IsSet && uuid.Value == null)
throw new ArgumentNullException(nameof(uuid), "Property is not nullable for class FormatTest.");

return new FormatTest(varByte.Value, date.Value.Value, number.Value.Value, password.Value, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, unsignedInteger, unsignedLong, uuid);
return new FormatTest(varByte.Value, date.Value.Value, number.Value.Value, password.Value, stringFormattedAsDecimalRequired.Value.Value, binary, dateTime, varDecimal, varDouble, varFloat, int32, int32Range, int64, int64Negative, int64NegativeExclusive, int64Positive, int64PositiveExclusive, integer, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, varString, stringFormattedAsDecimal, unsignedInteger, unsignedLong, uuid);
}

/// <summary>
Expand Down Expand Up @@ -901,6 +943,8 @@ public void WriteProperties(Utf8JsonWriter writer, FormatTest formatTest, JsonSe

writer.WriteString("password", formatTest.Password);

writer.WriteString("string_formatted_as_decimal_required", formatTest.StringFormattedAsDecimalRequired.ToString());

if (formatTest.BinaryOption.IsSet)
{
writer.WritePropertyName("binary");
Expand Down Expand Up @@ -956,6 +1000,9 @@ public void WriteProperties(Utf8JsonWriter writer, FormatTest formatTest, JsonSe
if (formatTest.StringOption.IsSet)
writer.WriteString("string", formatTest.String);

if (formatTest.StringFormattedAsDecimalOption.IsSet)
writer.WriteString("string_formatted_as_decimal", formatTest.StringFormattedAsDecimal.ToString());

if (formatTest.UnsignedIntegerOption.IsSet)
writer.WriteNumber("unsigned_integer", formatTest.UnsignedIntegerOption.Value.Value);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1706,11 +1706,18 @@ components:
pattern: "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\\
/([0-9]|[1-2][0-9]|3[0-2]))$"
type: string
string_formatted_as_decimal:
format: decimal
type: string
string_formatted_as_decimal_required:
format: decimal
type: string
required:
- byte
- date
- number
- password
- string_formatted_as_decimal_required
type: object
EnumClass:
default: -efg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Name | Type | Description | Notes
**Date** | **DateTime** | |
**Number** | **decimal** | |
**Password** | **string** | |
**StringFormattedAsDecimalRequired** | **decimal** | |
**Binary** | **System.IO.Stream** | | [optional]
**DateTime** | **DateTime** | | [optional]
**Decimal** | **decimal** | | [optional]
Expand All @@ -25,6 +26,7 @@ Name | Type | Description | Notes
**PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional]
**PatternWithDigitsAndDelimiter** | **string** | A string starting with &#39;image_&#39; (case insensitive) and one to three digits following i.e. Image_01. | [optional]
**String** | **string** | | [optional]
**StringFormattedAsDecimal** | **decimal** | | [optional]
**UnsignedInteger** | **uint** | | [optional]
**UnsignedLong** | **ulong** | | [optional]
**Uuid** | **Guid** | | [optional]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ public void PasswordTest()
// TODO unit test for the property 'Password'
}

/// <summary>
/// Test the property 'StringFormattedAsDecimalRequired'
/// </summary>
[Fact]
public void StringFormattedAsDecimalRequiredTest()
{
// TODO unit test for the property 'StringFormattedAsDecimalRequired'
}

/// <summary>
/// Test the property 'Binary'
/// </summary>
Expand Down Expand Up @@ -242,6 +251,15 @@ public void StringTest()
// TODO unit test for the property 'String'
}

/// <summary>
/// Test the property 'StringFormattedAsDecimal'
/// </summary>
[Fact]
public void StringFormattedAsDecimalTest()
{
// TODO unit test for the property 'StringFormattedAsDecimal'
}

/// <summary>
/// Test the property 'UnsignedInteger'
/// </summary>
Expand Down
Loading