forked from loafle/openapi-generator-original
made escaped regex be not literal strings (#15107)
This commit is contained in:
parent
3d7c173eb2
commit
3b11187200
@ -42,7 +42,7 @@ namespace {{packageName}}.Client
|
||||
/// <returns>Filename</returns>
|
||||
public static string SanitizeFilename(string filename)
|
||||
{
|
||||
Match match = Regex.Match(filename, @".*[/\\](.*)$");
|
||||
Match match = Regex.Match(filename, ".*[/\\](.*)$");
|
||||
return match.Success ? match.Groups[1].Value : filename;
|
||||
}
|
||||
|
||||
|
@ -96,7 +96,7 @@ namespace {{packageName}}.{{clientPackage}}
|
||||
/// <returns>Filename</returns>
|
||||
public static string SanitizeFilename(string filename)
|
||||
{
|
||||
Match match = Regex.Match(filename, @".*[/\\](.*)$");
|
||||
Match match = Regex.Match(filename, ".*[/\\](.*)$");
|
||||
return match.Success ? match.Groups[1].Value : filename;
|
||||
}
|
||||
|
||||
|
@ -74,7 +74,7 @@
|
||||
{{#pattern}}
|
||||
{{^isByteArray}}
|
||||
// {{{name}}} ({{{dataType}}}) pattern
|
||||
Regex regex{{{name}}} = new Regex(@"{{{vendorExtensions.x-regex}}}"{{#vendorExtensions.x-modifiers}}{{#-first}}, {{/-first}}RegexOptions.{{{.}}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}});
|
||||
Regex regex{{{name}}} = new Regex("{{{vendorExtensions.x-regex}}}"{{#vendorExtensions.x-modifiers}}{{#-first}}, {{/-first}}RegexOptions.{{{.}}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}});
|
||||
if (false == regex{{{name}}}.Match(this.{{{name}}}{{#isUuid}}.ToString(){{/isUuid}}).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, must match a pattern of " + regex{{{name}}}, new [] { "{{{name}}}" });
|
||||
|
@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// <returns>Filename</returns>
|
||||
public static string SanitizeFilename(string filename)
|
||||
{
|
||||
Match match = Regex.Match(filename, @".*[/\\](.*)$");
|
||||
Match match = Regex.Match(filename, ".*[/\\](.*)$");
|
||||
return match.Success ? match.Groups[1].Value : filename;
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// <returns>Filename</returns>
|
||||
public static string SanitizeFilename(string filename)
|
||||
{
|
||||
Match match = Regex.Match(filename, @".*[/\\](.*)$");
|
||||
Match match = Regex.Match(filename, ".*[/\\](.*)$");
|
||||
return match.Success ? match.Groups[1].Value : filename;
|
||||
}
|
||||
|
||||
|
@ -183,14 +183,14 @@ namespace Org.OpenAPITools.Model
|
||||
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
// Cultivar (string) pattern
|
||||
Regex regexCultivar = new Regex(@"^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant);
|
||||
Regex regexCultivar = new Regex("^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant);
|
||||
if (false == regexCultivar.Match(this.Cultivar).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
|
||||
}
|
||||
|
||||
// Origin (string) pattern
|
||||
Regex regexOrigin = new Regex(@"^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
Regex regexOrigin = new Regex("^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
if (false == regexOrigin.Match(this.Origin).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });
|
||||
|
@ -796,7 +796,7 @@ namespace Org.OpenAPITools.Model
|
||||
}
|
||||
|
||||
// String (string) pattern
|
||||
Regex regexString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
Regex regexString = new Regex("[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
if (false == regexString.Match(this.String).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" });
|
||||
@ -815,14 +815,14 @@ namespace Org.OpenAPITools.Model
|
||||
}
|
||||
|
||||
// PatternWithDigits (string) pattern
|
||||
Regex regexPatternWithDigits = new Regex(@"^\\d{10}$", RegexOptions.CultureInvariant);
|
||||
Regex regexPatternWithDigits = new Regex("^\\d{10}$", RegexOptions.CultureInvariant);
|
||||
if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
|
||||
}
|
||||
|
||||
// PatternWithDigitsAndDelimiter (string) pattern
|
||||
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
Regex regexPatternWithDigitsAndDelimiter = new Regex("^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
|
||||
|
@ -253,7 +253,7 @@ namespace Org.OpenAPITools.Model
|
||||
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
// UuidWithPattern (Guid) pattern
|
||||
Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
|
||||
Regex regexUuidWithPattern = new Regex("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
|
||||
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });
|
||||
|
@ -100,7 +100,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// <returns>Filename</returns>
|
||||
public static string SanitizeFilename(string filename)
|
||||
{
|
||||
Match match = Regex.Match(filename, @".*[/\\](.*)$");
|
||||
Match match = Regex.Match(filename, ".*[/\\](.*)$");
|
||||
return match.Success ? match.Groups[1].Value : filename;
|
||||
}
|
||||
|
||||
|
@ -82,14 +82,14 @@ namespace Org.OpenAPITools.Model
|
||||
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
// Cultivar (string) pattern
|
||||
Regex regexCultivar = new Regex(@"^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant);
|
||||
Regex regexCultivar = new Regex("^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant);
|
||||
if (false == regexCultivar.Match(this.Cultivar).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
|
||||
}
|
||||
|
||||
// Origin (string) pattern
|
||||
Regex regexOrigin = new Regex(@"^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
Regex regexOrigin = new Regex("^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
if (false == regexOrigin.Match(this.Origin).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });
|
||||
|
@ -303,21 +303,21 @@ namespace Org.OpenAPITools.Model
|
||||
}
|
||||
|
||||
// PatternWithDigits (string) pattern
|
||||
Regex regexPatternWithDigits = new Regex(@"^\\d{10}$", RegexOptions.CultureInvariant);
|
||||
Regex regexPatternWithDigits = new Regex("^\\d{10}$", RegexOptions.CultureInvariant);
|
||||
if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
|
||||
}
|
||||
|
||||
// PatternWithDigitsAndDelimiter (string) pattern
|
||||
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
Regex regexPatternWithDigitsAndDelimiter = new Regex("^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
|
||||
}
|
||||
|
||||
// StringProperty (string) pattern
|
||||
Regex regexStringProperty = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
Regex regexStringProperty = new Regex("[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
if (false == regexStringProperty.Match(this.StringProperty).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StringProperty, must match a pattern of " + regexStringProperty, new [] { "StringProperty" });
|
||||
|
@ -100,7 +100,7 @@ namespace Org.OpenAPITools.Model
|
||||
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
// UuidWithPattern (Guid) pattern
|
||||
Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
|
||||
Regex regexUuidWithPattern = new Regex("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
|
||||
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });
|
||||
|
@ -98,7 +98,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// <returns>Filename</returns>
|
||||
public static string SanitizeFilename(string filename)
|
||||
{
|
||||
Match match = Regex.Match(filename, @".*[/\\](.*)$");
|
||||
Match match = Regex.Match(filename, ".*[/\\](.*)$");
|
||||
return match.Success ? match.Groups[1].Value : filename;
|
||||
}
|
||||
|
||||
|
@ -80,14 +80,14 @@ namespace Org.OpenAPITools.Model
|
||||
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
// Cultivar (string) pattern
|
||||
Regex regexCultivar = new Regex(@"^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant);
|
||||
Regex regexCultivar = new Regex("^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant);
|
||||
if (false == regexCultivar.Match(this.Cultivar).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
|
||||
}
|
||||
|
||||
// Origin (string) pattern
|
||||
Regex regexOrigin = new Regex(@"^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
Regex regexOrigin = new Regex("^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
if (false == regexOrigin.Match(this.Origin).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });
|
||||
|
@ -301,21 +301,21 @@ namespace Org.OpenAPITools.Model
|
||||
}
|
||||
|
||||
// PatternWithDigits (string) pattern
|
||||
Regex regexPatternWithDigits = new Regex(@"^\\d{10}$", RegexOptions.CultureInvariant);
|
||||
Regex regexPatternWithDigits = new Regex("^\\d{10}$", RegexOptions.CultureInvariant);
|
||||
if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
|
||||
}
|
||||
|
||||
// PatternWithDigitsAndDelimiter (string) pattern
|
||||
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
Regex regexPatternWithDigitsAndDelimiter = new Regex("^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
|
||||
}
|
||||
|
||||
// StringProperty (string) pattern
|
||||
Regex regexStringProperty = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
Regex regexStringProperty = new Regex("[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
if (false == regexStringProperty.Match(this.StringProperty).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StringProperty, must match a pattern of " + regexStringProperty, new [] { "StringProperty" });
|
||||
|
@ -98,7 +98,7 @@ namespace Org.OpenAPITools.Model
|
||||
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
// UuidWithPattern (Guid) pattern
|
||||
Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
|
||||
Regex regexUuidWithPattern = new Regex("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
|
||||
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });
|
||||
|
@ -100,7 +100,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// <returns>Filename</returns>
|
||||
public static string SanitizeFilename(string filename)
|
||||
{
|
||||
Match match = Regex.Match(filename, @".*[/\\](.*)$");
|
||||
Match match = Regex.Match(filename, ".*[/\\](.*)$");
|
||||
return match.Success ? match.Groups[1].Value : filename;
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// <returns>Filename</returns>
|
||||
public static string SanitizeFilename(string filename)
|
||||
{
|
||||
Match match = Regex.Match(filename, @".*[/\\](.*)$");
|
||||
Match match = Regex.Match(filename, ".*[/\\](.*)$");
|
||||
return match.Success ? match.Groups[1].Value : filename;
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// <returns>Filename</returns>
|
||||
public static string SanitizeFilename(string filename)
|
||||
{
|
||||
Match match = Regex.Match(filename, @".*[/\\](.*)$");
|
||||
Match match = Regex.Match(filename, ".*[/\\](.*)$");
|
||||
return match.Success ? match.Groups[1].Value : filename;
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// <returns>Filename</returns>
|
||||
public static string SanitizeFilename(string filename)
|
||||
{
|
||||
Match match = Regex.Match(filename, @".*[/\\](.*)$");
|
||||
Match match = Regex.Match(filename, ".*[/\\](.*)$");
|
||||
return match.Success ? match.Groups[1].Value : filename;
|
||||
}
|
||||
|
||||
|
@ -80,14 +80,14 @@ namespace Org.OpenAPITools.Model
|
||||
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
// Cultivar (string) pattern
|
||||
Regex regexCultivar = new Regex(@"^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant);
|
||||
Regex regexCultivar = new Regex("^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant);
|
||||
if (false == regexCultivar.Match(this.Cultivar).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
|
||||
}
|
||||
|
||||
// Origin (string) pattern
|
||||
Regex regexOrigin = new Regex(@"^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
Regex regexOrigin = new Regex("^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
if (false == regexOrigin.Match(this.Origin).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });
|
||||
|
@ -301,21 +301,21 @@ namespace Org.OpenAPITools.Model
|
||||
}
|
||||
|
||||
// PatternWithDigits (string) pattern
|
||||
Regex regexPatternWithDigits = new Regex(@"^\\d{10}$", RegexOptions.CultureInvariant);
|
||||
Regex regexPatternWithDigits = new Regex("^\\d{10}$", RegexOptions.CultureInvariant);
|
||||
if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
|
||||
}
|
||||
|
||||
// PatternWithDigitsAndDelimiter (string) pattern
|
||||
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
Regex regexPatternWithDigitsAndDelimiter = new Regex("^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
|
||||
}
|
||||
|
||||
// StringProperty (string) pattern
|
||||
Regex regexStringProperty = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
Regex regexStringProperty = new Regex("[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
if (false == regexStringProperty.Match(this.StringProperty).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StringProperty, must match a pattern of " + regexStringProperty, new [] { "StringProperty" });
|
||||
|
@ -98,7 +98,7 @@ namespace Org.OpenAPITools.Model
|
||||
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
// UuidWithPattern (Guid) pattern
|
||||
Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
|
||||
Regex regexUuidWithPattern = new Regex("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
|
||||
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });
|
||||
|
@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// <returns>Filename</returns>
|
||||
public static string SanitizeFilename(string filename)
|
||||
{
|
||||
Match match = Regex.Match(filename, @".*[/\\](.*)$");
|
||||
Match match = Regex.Match(filename, ".*[/\\](.*)$");
|
||||
return match.Success ? match.Groups[1].Value : filename;
|
||||
}
|
||||
|
||||
|
@ -140,14 +140,14 @@ namespace Org.OpenAPITools.Model
|
||||
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
// Cultivar (string) pattern
|
||||
Regex regexCultivar = new Regex(@"^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant);
|
||||
Regex regexCultivar = new Regex("^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant);
|
||||
if (false == regexCultivar.Match(this.Cultivar).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
|
||||
}
|
||||
|
||||
// Origin (string) pattern
|
||||
Regex regexOrigin = new Regex(@"^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
Regex regexOrigin = new Regex("^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
if (false == regexOrigin.Match(this.Origin).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });
|
||||
|
@ -417,7 +417,7 @@ namespace Org.OpenAPITools.Model
|
||||
}
|
||||
|
||||
// String (string) pattern
|
||||
Regex regexString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
Regex regexString = new Regex("[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
if (false == regexString.Match(this.String).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" });
|
||||
@ -436,14 +436,14 @@ namespace Org.OpenAPITools.Model
|
||||
}
|
||||
|
||||
// PatternWithDigits (string) pattern
|
||||
Regex regexPatternWithDigits = new Regex(@"^\\d{10}$", RegexOptions.CultureInvariant);
|
||||
Regex regexPatternWithDigits = new Regex("^\\d{10}$", RegexOptions.CultureInvariant);
|
||||
if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
|
||||
}
|
||||
|
||||
// PatternWithDigitsAndDelimiter (string) pattern
|
||||
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
Regex regexPatternWithDigitsAndDelimiter = new Regex("^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
|
||||
|
@ -166,7 +166,7 @@ namespace Org.OpenAPITools.Model
|
||||
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
// UuidWithPattern (Guid) pattern
|
||||
Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
|
||||
Regex regexUuidWithPattern = new Regex("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
|
||||
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });
|
||||
|
@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// <returns>Filename</returns>
|
||||
public static string SanitizeFilename(string filename)
|
||||
{
|
||||
Match match = Regex.Match(filename, @".*[/\\](.*)$");
|
||||
Match match = Regex.Match(filename, ".*[/\\](.*)$");
|
||||
return match.Success ? match.Groups[1].Value : filename;
|
||||
}
|
||||
|
||||
|
@ -139,14 +139,14 @@ namespace Org.OpenAPITools.Model
|
||||
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
// Cultivar (string) pattern
|
||||
Regex regexCultivar = new Regex(@"^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant);
|
||||
Regex regexCultivar = new Regex("^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant);
|
||||
if (false == regexCultivar.Match(this.Cultivar).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
|
||||
}
|
||||
|
||||
// Origin (string) pattern
|
||||
Regex regexOrigin = new Regex(@"^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
Regex regexOrigin = new Regex("^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
if (false == regexOrigin.Match(this.Origin).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });
|
||||
|
@ -416,7 +416,7 @@ namespace Org.OpenAPITools.Model
|
||||
}
|
||||
|
||||
// String (string) pattern
|
||||
Regex regexString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
Regex regexString = new Regex("[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
if (false == regexString.Match(this.String).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" });
|
||||
@ -435,14 +435,14 @@ namespace Org.OpenAPITools.Model
|
||||
}
|
||||
|
||||
// PatternWithDigits (string) pattern
|
||||
Regex regexPatternWithDigits = new Regex(@"^\\d{10}$", RegexOptions.CultureInvariant);
|
||||
Regex regexPatternWithDigits = new Regex("^\\d{10}$", RegexOptions.CultureInvariant);
|
||||
if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
|
||||
}
|
||||
|
||||
// PatternWithDigitsAndDelimiter (string) pattern
|
||||
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
Regex regexPatternWithDigitsAndDelimiter = new Regex("^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
|
||||
|
@ -165,7 +165,7 @@ namespace Org.OpenAPITools.Model
|
||||
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
// UuidWithPattern (Guid) pattern
|
||||
Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
|
||||
Regex regexUuidWithPattern = new Regex("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
|
||||
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });
|
||||
|
@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// <returns>Filename</returns>
|
||||
public static string SanitizeFilename(string filename)
|
||||
{
|
||||
Match match = Regex.Match(filename, @".*[/\\](.*)$");
|
||||
Match match = Regex.Match(filename, ".*[/\\](.*)$");
|
||||
return match.Success ? match.Groups[1].Value : filename;
|
||||
}
|
||||
|
||||
|
@ -139,14 +139,14 @@ namespace Org.OpenAPITools.Model
|
||||
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
// Cultivar (string) pattern
|
||||
Regex regexCultivar = new Regex(@"^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant);
|
||||
Regex regexCultivar = new Regex("^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant);
|
||||
if (false == regexCultivar.Match(this.Cultivar).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
|
||||
}
|
||||
|
||||
// Origin (string) pattern
|
||||
Regex regexOrigin = new Regex(@"^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
Regex regexOrigin = new Regex("^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
if (false == regexOrigin.Match(this.Origin).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });
|
||||
|
@ -416,7 +416,7 @@ namespace Org.OpenAPITools.Model
|
||||
}
|
||||
|
||||
// String (string) pattern
|
||||
Regex regexString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
Regex regexString = new Regex("[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
if (false == regexString.Match(this.String).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" });
|
||||
@ -435,14 +435,14 @@ namespace Org.OpenAPITools.Model
|
||||
}
|
||||
|
||||
// PatternWithDigits (string) pattern
|
||||
Regex regexPatternWithDigits = new Regex(@"^\\d{10}$", RegexOptions.CultureInvariant);
|
||||
Regex regexPatternWithDigits = new Regex("^\\d{10}$", RegexOptions.CultureInvariant);
|
||||
if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
|
||||
}
|
||||
|
||||
// PatternWithDigitsAndDelimiter (string) pattern
|
||||
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
Regex regexPatternWithDigitsAndDelimiter = new Regex("^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
|
||||
|
@ -165,7 +165,7 @@ namespace Org.OpenAPITools.Model
|
||||
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
// UuidWithPattern (Guid) pattern
|
||||
Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
|
||||
Regex regexUuidWithPattern = new Regex("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
|
||||
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });
|
||||
|
@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// <returns>Filename</returns>
|
||||
public static string SanitizeFilename(string filename)
|
||||
{
|
||||
Match match = Regex.Match(filename, @".*[/\\](.*)$");
|
||||
Match match = Regex.Match(filename, ".*[/\\](.*)$");
|
||||
return match.Success ? match.Groups[1].Value : filename;
|
||||
}
|
||||
|
||||
|
@ -139,14 +139,14 @@ namespace Org.OpenAPITools.Model
|
||||
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
// Cultivar (string) pattern
|
||||
Regex regexCultivar = new Regex(@"^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant);
|
||||
Regex regexCultivar = new Regex("^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant);
|
||||
if (false == regexCultivar.Match(this.Cultivar).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
|
||||
}
|
||||
|
||||
// Origin (string) pattern
|
||||
Regex regexOrigin = new Regex(@"^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
Regex regexOrigin = new Regex("^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
if (false == regexOrigin.Match(this.Origin).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });
|
||||
|
@ -416,7 +416,7 @@ namespace Org.OpenAPITools.Model
|
||||
}
|
||||
|
||||
// String (string) pattern
|
||||
Regex regexString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
Regex regexString = new Regex("[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
if (false == regexString.Match(this.String).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" });
|
||||
@ -435,14 +435,14 @@ namespace Org.OpenAPITools.Model
|
||||
}
|
||||
|
||||
// PatternWithDigits (string) pattern
|
||||
Regex regexPatternWithDigits = new Regex(@"^\\d{10}$", RegexOptions.CultureInvariant);
|
||||
Regex regexPatternWithDigits = new Regex("^\\d{10}$", RegexOptions.CultureInvariant);
|
||||
if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
|
||||
}
|
||||
|
||||
// PatternWithDigitsAndDelimiter (string) pattern
|
||||
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
Regex regexPatternWithDigitsAndDelimiter = new Regex("^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
|
||||
|
@ -165,7 +165,7 @@ namespace Org.OpenAPITools.Model
|
||||
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
// UuidWithPattern (Guid) pattern
|
||||
Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
|
||||
Regex regexUuidWithPattern = new Regex("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
|
||||
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });
|
||||
|
@ -32,7 +32,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// <returns>Filename</returns>
|
||||
public static string SanitizeFilename(string filename)
|
||||
{
|
||||
Match match = Regex.Match(filename, @".*[/\\](.*)$");
|
||||
Match match = Regex.Match(filename, ".*[/\\](.*)$");
|
||||
return match.Success ? match.Groups[1].Value : filename;
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// <returns>Filename</returns>
|
||||
public static string SanitizeFilename(string filename)
|
||||
{
|
||||
Match match = Regex.Match(filename, @".*[/\\](.*)$");
|
||||
Match match = Regex.Match(filename, ".*[/\\](.*)$");
|
||||
return match.Success ? match.Groups[1].Value : filename;
|
||||
}
|
||||
|
||||
|
@ -139,14 +139,14 @@ namespace Org.OpenAPITools.Model
|
||||
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
// Cultivar (string) pattern
|
||||
Regex regexCultivar = new Regex(@"^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant);
|
||||
Regex regexCultivar = new Regex("^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant);
|
||||
if (false == regexCultivar.Match(this.Cultivar).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
|
||||
}
|
||||
|
||||
// Origin (string) pattern
|
||||
Regex regexOrigin = new Regex(@"^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
Regex regexOrigin = new Regex("^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
if (false == regexOrigin.Match(this.Origin).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });
|
||||
|
@ -416,7 +416,7 @@ namespace Org.OpenAPITools.Model
|
||||
}
|
||||
|
||||
// String (string) pattern
|
||||
Regex regexString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
Regex regexString = new Regex("[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
if (false == regexString.Match(this.String).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" });
|
||||
@ -435,14 +435,14 @@ namespace Org.OpenAPITools.Model
|
||||
}
|
||||
|
||||
// PatternWithDigits (string) pattern
|
||||
Regex regexPatternWithDigits = new Regex(@"^\\d{10}$", RegexOptions.CultureInvariant);
|
||||
Regex regexPatternWithDigits = new Regex("^\\d{10}$", RegexOptions.CultureInvariant);
|
||||
if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
|
||||
}
|
||||
|
||||
// PatternWithDigitsAndDelimiter (string) pattern
|
||||
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
Regex regexPatternWithDigitsAndDelimiter = new Regex("^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
|
||||
|
@ -165,7 +165,7 @@ namespace Org.OpenAPITools.Model
|
||||
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
// UuidWithPattern (Guid) pattern
|
||||
Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
|
||||
Regex regexUuidWithPattern = new Regex("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
|
||||
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });
|
||||
|
@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// <returns>Filename</returns>
|
||||
public static string SanitizeFilename(string filename)
|
||||
{
|
||||
Match match = Regex.Match(filename, @".*[/\\](.*)$");
|
||||
Match match = Regex.Match(filename, ".*[/\\](.*)$");
|
||||
return match.Success ? match.Groups[1].Value : filename;
|
||||
}
|
||||
|
||||
|
@ -127,14 +127,14 @@ namespace Org.OpenAPITools.Model
|
||||
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
// Cultivar (string) pattern
|
||||
Regex regexCultivar = new Regex(@"^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant);
|
||||
Regex regexCultivar = new Regex("^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant);
|
||||
if (false == regexCultivar.Match(this.Cultivar).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
|
||||
}
|
||||
|
||||
// Origin (string) pattern
|
||||
Regex regexOrigin = new Regex(@"^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
Regex regexOrigin = new Regex("^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
if (false == regexOrigin.Match(this.Origin).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });
|
||||
|
@ -401,7 +401,7 @@ namespace Org.OpenAPITools.Model
|
||||
}
|
||||
|
||||
// String (string) pattern
|
||||
Regex regexString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
Regex regexString = new Regex("[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
if (false == regexString.Match(this.String).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" });
|
||||
@ -420,14 +420,14 @@ namespace Org.OpenAPITools.Model
|
||||
}
|
||||
|
||||
// PatternWithDigits (string) pattern
|
||||
Regex regexPatternWithDigits = new Regex(@"^\\d{10}$", RegexOptions.CultureInvariant);
|
||||
Regex regexPatternWithDigits = new Regex("^\\d{10}$", RegexOptions.CultureInvariant);
|
||||
if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
|
||||
}
|
||||
|
||||
// PatternWithDigitsAndDelimiter (string) pattern
|
||||
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
Regex regexPatternWithDigitsAndDelimiter = new Regex("^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
|
||||
|
@ -153,7 +153,7 @@ namespace Org.OpenAPITools.Model
|
||||
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
// UuidWithPattern (Guid) pattern
|
||||
Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
|
||||
Regex regexUuidWithPattern = new Regex("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
|
||||
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });
|
||||
|
@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// <returns>Filename</returns>
|
||||
public static string SanitizeFilename(string filename)
|
||||
{
|
||||
Match match = Regex.Match(filename, @".*[/\\](.*)$");
|
||||
Match match = Regex.Match(filename, ".*[/\\](.*)$");
|
||||
return match.Success ? match.Groups[1].Value : filename;
|
||||
}
|
||||
|
||||
|
@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model
|
||||
public IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> Validate(ValidationContext validationContext)
|
||||
{
|
||||
// Name (string) pattern
|
||||
Regex regexName = new Regex(@"^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$", RegexOptions.CultureInvariant);
|
||||
Regex regexName = new Regex("^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$", RegexOptions.CultureInvariant);
|
||||
if (false == regexName.Match(this.Name).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Name, must match a pattern of " + regexName, new [] { "Name" });
|
||||
|
Loading…
x
Reference in New Issue
Block a user