You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Update modelGeneric.mustache
If maxlength is specified for a property type enum it there should be .ToString() appended before length check
* ran the csharp petstore bar and updated the file
Co-authored-by: Shweta Shukla <shshukl@microsoft.com>
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, length must be less than {{maxLength}}.", new [] { "{{{name}}}"});
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, length must be less than {{maxLength}}.", new [] { "{{{name}}}"});
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, length must be greater than {{minLength}}.", new [] { "{{{name}}}"});
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, length must be greater than {{minLength}}.", new [] { "{{{name}}}"});
@@ -379,6 +381,8 @@ public override int GetHashCode()
379
381
yieldreturnnewSystem.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Integer, must be a value greater than or equal to 10.",new[]{"Integer"});
380
382
}
381
383
384
+
385
+
382
386
// Int32 (int) maximum
383
387
if(this.Int32>(int)200)
384
388
{
@@ -391,6 +395,8 @@ public override int GetHashCode()
391
395
yieldreturnnewSystem.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Int32, must be a value greater than or equal to 20.",new[]{"Int32"});
392
396
}
393
397
398
+
399
+
394
400
// Number (decimal) maximum
395
401
if(this.Number>(decimal)543.2)
396
402
{
@@ -403,6 +409,8 @@ public override int GetHashCode()
403
409
yieldreturnnewSystem.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Number, must be a value greater than or equal to 32.1.",new[]{"Number"});
404
410
}
405
411
412
+
413
+
406
414
// Float (float) maximum
407
415
if(this.Float>(float)987.6)
408
416
{
@@ -415,6 +423,8 @@ public override int GetHashCode()
415
423
yieldreturnnewSystem.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Float, must be a value greater than or equal to 54.3.",new[]{"Float"});
416
424
}
417
425
426
+
427
+
418
428
// Double (double) maximum
419
429
if(this.Double>(double)123.4)
420
430
{
@@ -427,13 +437,17 @@ public override int GetHashCode()
427
437
yieldreturnnewSystem.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Double, must be a value greater than or equal to 67.8.",new[]{"Double"});
yieldreturnnewSystem.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of "+regexString,new[]{"String"});
435
447
}
436
448
449
+
450
+
437
451
// Password (string) maxLength
438
452
if(this.Password!=null&&this.Password.Length>64)
439
453
{
@@ -445,7 +459,7 @@ public override int GetHashCode()
445
459
{
446
460
yieldreturnnewSystem.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.",new[]{"Password"});
0 commit comments