Skip to content

Commit fd87359

Browse files
committed
update c# petstore sample to remove pattern check for byte array
1 parent 921e4a7 commit fd87359

File tree

2 files changed

+2
-16
lines changed
  • samples/client/petstore/csharp

2 files changed

+2
-16
lines changed

samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/FormatTest.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -415,14 +415,7 @@ public override int GetHashCode()
415415
Regex regex_String = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
416416
if (false == regex_String.Match(this._String).Success)
417417
{
418-
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _String, must match a pattern of /[a-z]/i.", new [] { "_String" });
419-
}
420-
421-
// _Byte (byte[]) pattern
422-
Regex regex_Byte = new Regex(@"^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$", RegexOptions.CultureInvariant);
423-
if (false == regex_Byte.Match(this._Byte).Success)
424-
{
425-
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _Byte, must match a pattern of /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.", new [] { "_Byte" });
418+
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _String, must match a pattern of " + regex_String, new [] { "_String" });
426419
}
427420

428421
// Password (string) maxLength

samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/FormatTest.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -438,14 +438,7 @@ public virtual void OnPropertyChanged(string propertyName)
438438
Regex regex_String = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
439439
if (false == regex_String.Match(this._String).Success)
440440
{
441-
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _String, must match a pattern of /[a-z]/i.", new [] { "_String" });
442-
}
443-
444-
// _Byte (byte[]) pattern
445-
Regex regex_Byte = new Regex(@"^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$", RegexOptions.CultureInvariant);
446-
if (false == regex_Byte.Match(this._Byte).Success)
447-
{
448-
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _Byte, must match a pattern of /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.", new [] { "_Byte" });
441+
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _String, must match a pattern of " + regex_String, new [] { "_String" });
449442
}
450443

451444
// Password (string) maxLength

0 commit comments

Comments
 (0)