Skip to content

Commit 0238e72

Browse files
committed
Add back exclusive range
1 parent bb22aca commit 0238e72

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

test/OpenApiKiotaEndToEndTests/ModelStateValidation/ModelStateValidationTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ public async Task Cannot_use_double_outside_of_valid_range(double age)
358358

359359
ErrorObject errorObject = document.Errors.First();
360360
errorObject.Title.Should().Be("Input validation failed.");
361-
errorObject.Detail.Should().Be("The field Age must be between 0.1 and 122.9.");
361+
errorObject.Detail.Should().Be("The field Age must be between 0.1 exclusive and 122.9 exclusive.");
362362
errorObject.Source.ShouldNotBeNull();
363363
errorObject.Source.Pointer.Should().Be("/data/attributes/age");
364364
}

test/OpenApiNSwagEndToEndTests/ModelStateValidation/ModelStateValidationTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ public async Task Cannot_use_double_outside_of_valid_range(double age)
351351

352352
ErrorObject errorObject = document.Errors.First();
353353
errorObject.Title.Should().Be("Input validation failed.");
354-
errorObject.Detail.Should().Be("The field Age must be between 0.1 and 122.9.");
354+
errorObject.Detail.Should().Be("The field Age must be between 0.1 exclusive and 122.9 exclusive.");
355355
errorObject.Source.ShouldNotBeNull();
356356
errorObject.Source.Pointer.Should().Be("/data/attributes/age");
357357
}

test/OpenApiTests/ModelStateValidation/SocialMediaAccount.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ public sealed class SocialMediaAccount : Identifiable<Guid>
4949
public string? Phone { get; set; }
5050

5151
[Attr]
52+
#if NET6_0
5253
[Range(0.1, 122.9)]
54+
#else
55+
[Range(0.1, 122.9, MinimumIsExclusive = true, MaximumIsExclusive = true)]
56+
#endif
5357
public double? Age { get; set; }
5458

5559
[Attr]

0 commit comments

Comments
 (0)