mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-10-02 15:53:30 -05:00
Validator allows empty string
This commit is contained in:
@@ -100,6 +100,12 @@ namespace UniJSON
|
||||
{
|
||||
var c = new JsonSchemaValidationContext("test");
|
||||
|
||||
{
|
||||
var v = new JsonStringValidator();
|
||||
Assert.Null(v.Validate(c, ""));
|
||||
Assert.Null(v.Validate(c, "a"));
|
||||
}
|
||||
|
||||
{
|
||||
var v = new JsonStringValidator();
|
||||
v.MinLength = 1;
|
||||
|
||||
@@ -111,10 +111,6 @@ namespace UniJSON
|
||||
}
|
||||
|
||||
var value = o as string;
|
||||
if (value.All(x => Char.IsWhiteSpace(x)))
|
||||
{
|
||||
return new JsonSchemaValidationException(c, "whitespace");
|
||||
}
|
||||
|
||||
if (MinLength.HasValue && value.Length < MinLength)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user