forked from loafle/openapi-generator-original
fixed nre (#16036)
This commit is contained in:
parent
2c5f8b30b4
commit
1d470c3866
@ -416,7 +416,9 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
|
|||||||
.put("joinWithComma", new JoinWithCommaLambda())
|
.put("joinWithComma", new JoinWithCommaLambda())
|
||||||
.put("trimLineBreaks", new TrimLineBreaksLambda())
|
.put("trimLineBreaks", new TrimLineBreaksLambda())
|
||||||
.put("trimTrailingWhiteSpace", new TrimTrailingWhiteSpaceLambda())
|
.put("trimTrailingWhiteSpace", new TrimTrailingWhiteSpaceLambda())
|
||||||
.put("first", new FirstLambda());
|
.put("first", new FirstLambda())
|
||||||
|
.put("indent3", new IndentedLambda(12, " "))
|
||||||
|
.put("indent4", new IndentedLambda(16, " "));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
6
modules/openapi-generator/src/main/resources/csharp/ValidateRegex.mustache
vendored
Normal file
6
modules/openapi-generator/src/main/resources/csharp/ValidateRegex.mustache
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
// {{{name}}} ({{{dataType}}}) pattern
|
||||||
|
Regex regex{{{name}}} = new Regex(@"{{{vendorExtensions.x-regex}}}"{{#vendorExtensions.x-modifiers}}{{#-first}}, {{/-first}}RegexOptions.{{{.}}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}});
|
||||||
|
if (!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}}}" });
|
||||||
|
}
|
@ -73,13 +73,30 @@
|
|||||||
{{/minimum}}
|
{{/minimum}}
|
||||||
{{#pattern}}
|
{{#pattern}}
|
||||||
{{^isByteArray}}
|
{{^isByteArray}}
|
||||||
// {{{name}}} ({{{dataType}}}) pattern
|
{{#vendorExtensions.x-is-value-type}}
|
||||||
Regex regex{{{name}}} = new Regex(@"{{{vendorExtensions.x-regex}}}"{{#vendorExtensions.x-modifiers}}{{#-first}}, {{/-first}}RegexOptions.{{{.}}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}});
|
{{#isNullable}}
|
||||||
if (false == regex{{{name}}}.Match(this.{{{name}}}{{#isUuid}}.ToString(){{/isUuid}}).Success)
|
if (this.{{{name}}} != null){
|
||||||
{
|
{{#lambda.indent4}}
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, must match a pattern of " + regex{{{name}}}, new [] { "{{{name}}}" });
|
{{>ValidateRegex}}
|
||||||
|
{{/lambda.indent4}}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{{/isNullable}}
|
||||||
|
{{^isNullable}}
|
||||||
|
{{#lambda.indent3}}
|
||||||
|
{{>ValidateRegex}}
|
||||||
|
|
||||||
|
{{/lambda.indent3}}
|
||||||
|
{{/isNullable}}
|
||||||
|
{{/vendorExtensions.x-is-value-type}}
|
||||||
|
{{^vendorExtensions.x-is-value-type}}
|
||||||
|
if (this.{{{name}}} != null) {
|
||||||
|
{{#lambda.indent4}}
|
||||||
|
{{>ValidateRegex}}
|
||||||
|
{{/lambda.indent4}}
|
||||||
|
}
|
||||||
|
|
||||||
|
{{/vendorExtensions.x-is-value-type}}
|
||||||
{{/isByteArray}}
|
{{/isByteArray}}
|
||||||
{{/pattern}}
|
{{/pattern}}
|
||||||
{{/isEnum}}
|
{{/isEnum}}
|
||||||
|
@ -182,19 +182,21 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <returns>Validation Result</returns>
|
/// <returns>Validation Result</returns>
|
||||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
{
|
{
|
||||||
// Cultivar (string) pattern
|
if (this.Cultivar != null) {
|
||||||
Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant);
|
// Cultivar (string) pattern
|
||||||
if (false == regexCultivar.Match(this.Cultivar).Success)
|
Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant);
|
||||||
{
|
if (!regexCultivar.Match(this.Cultivar).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
|
||||||
|
} }
|
||||||
|
|
||||||
// Origin (string) pattern
|
if (this.Origin != null) {
|
||||||
Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
// Origin (string) pattern
|
||||||
if (false == regexOrigin.Match(this.Origin).Success)
|
Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||||
{
|
if (!regexOrigin.Match(this.Origin).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });
|
||||||
|
} }
|
||||||
|
|
||||||
yield break;
|
yield break;
|
||||||
}
|
}
|
||||||
|
@ -831,12 +831,13 @@ namespace Org.OpenAPITools.Model
|
|||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarDouble, must be a value greater than or equal to 67.8.", new [] { "VarDouble" });
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarDouble, must be a value greater than or equal to 67.8.", new [] { "VarDouble" });
|
||||||
}
|
}
|
||||||
|
|
||||||
// VarString (string) pattern
|
if (this.VarString != null) {
|
||||||
Regex regexVarString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
// VarString (string) pattern
|
||||||
if (false == regexVarString.Match(this.VarString).Success)
|
Regex regexVarString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||||
{
|
if (!regexVarString.Match(this.VarString).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarString, must match a pattern of " + regexVarString, new [] { "VarString" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarString, must match a pattern of " + regexVarString, new [] { "VarString" });
|
||||||
|
} }
|
||||||
|
|
||||||
// Password (string) maxLength
|
// Password (string) maxLength
|
||||||
if (this.Password != null && this.Password.Length > 64)
|
if (this.Password != null && this.Password.Length > 64)
|
||||||
@ -850,26 +851,29 @@ namespace Org.OpenAPITools.Model
|
|||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" });
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" });
|
||||||
}
|
}
|
||||||
|
|
||||||
// PatternWithDigits (string) pattern
|
if (this.PatternWithDigits != null) {
|
||||||
Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant);
|
// PatternWithDigits (string) pattern
|
||||||
if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success)
|
Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant);
|
||||||
{
|
if (!regexPatternWithDigits.Match(this.PatternWithDigits).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
|
||||||
|
} }
|
||||||
|
|
||||||
// PatternWithDigitsAndDelimiter (string) pattern
|
if (this.PatternWithDigitsAndDelimiter != null) {
|
||||||
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
// PatternWithDigitsAndDelimiter (string) pattern
|
||||||
if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
|
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||||
{
|
if (!regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
|
||||||
|
} }
|
||||||
|
|
||||||
// PatternWithBackslash (string) pattern
|
if (this.PatternWithBackslash != null) {
|
||||||
Regex regexPatternWithBackslash = new Regex(@"^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", RegexOptions.CultureInvariant);
|
// PatternWithBackslash (string) pattern
|
||||||
if (false == regexPatternWithBackslash.Match(this.PatternWithBackslash).Success)
|
Regex regexPatternWithBackslash = new Regex(@"^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", RegexOptions.CultureInvariant);
|
||||||
{
|
if (!regexPatternWithBackslash.Match(this.PatternWithBackslash).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" });
|
||||||
|
} }
|
||||||
|
|
||||||
yield break;
|
yield break;
|
||||||
}
|
}
|
||||||
|
@ -252,12 +252,13 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <returns>Validation Result</returns>
|
/// <returns>Validation Result</returns>
|
||||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
{
|
{
|
||||||
// UuidWithPattern (Guid) pattern
|
if (this.UuidWithPattern != null) {
|
||||||
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);
|
// UuidWithPattern (Guid) pattern
|
||||||
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
|
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 (!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" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });
|
||||||
|
} }
|
||||||
|
|
||||||
yield break;
|
yield break;
|
||||||
}
|
}
|
||||||
|
@ -85,19 +85,21 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <returns>Validation Result</returns>
|
/// <returns>Validation Result</returns>
|
||||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
{
|
{
|
||||||
// Cultivar (string) pattern
|
if (this.Cultivar != null) {
|
||||||
Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant);
|
// Cultivar (string) pattern
|
||||||
if (false == regexCultivar.Match(this.Cultivar).Success)
|
Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant);
|
||||||
{
|
if (!regexCultivar.Match(this.Cultivar).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
|
||||||
|
} }
|
||||||
|
|
||||||
// Origin (string) pattern
|
if (this.Origin != null) {
|
||||||
Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
// Origin (string) pattern
|
||||||
if (false == regexOrigin.Match(this.Origin).Success)
|
Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||||
{
|
if (!regexOrigin.Match(this.Origin).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });
|
||||||
|
} }
|
||||||
|
|
||||||
yield break;
|
yield break;
|
||||||
}
|
}
|
||||||
|
@ -316,33 +316,37 @@ namespace Org.OpenAPITools.Model
|
|||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" });
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" });
|
||||||
}
|
}
|
||||||
|
|
||||||
// PatternWithBackslash (string) pattern
|
if (this.PatternWithBackslash != null) {
|
||||||
Regex regexPatternWithBackslash = new Regex(@"^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", RegexOptions.CultureInvariant);
|
// PatternWithBackslash (string) pattern
|
||||||
if (false == regexPatternWithBackslash.Match(this.PatternWithBackslash).Success)
|
Regex regexPatternWithBackslash = new Regex(@"^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", RegexOptions.CultureInvariant);
|
||||||
{
|
if (!regexPatternWithBackslash.Match(this.PatternWithBackslash).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" });
|
||||||
|
} }
|
||||||
|
|
||||||
// PatternWithDigits (string) pattern
|
if (this.PatternWithDigits != null) {
|
||||||
Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant);
|
// PatternWithDigits (string) pattern
|
||||||
if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success)
|
Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant);
|
||||||
{
|
if (!regexPatternWithDigits.Match(this.PatternWithDigits).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
|
||||||
|
} }
|
||||||
|
|
||||||
// PatternWithDigitsAndDelimiter (string) pattern
|
if (this.PatternWithDigitsAndDelimiter != null) {
|
||||||
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
// PatternWithDigitsAndDelimiter (string) pattern
|
||||||
if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
|
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||||
{
|
if (!regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
|
||||||
|
} }
|
||||||
|
|
||||||
// VarString (string) pattern
|
if (this.VarString != null) {
|
||||||
Regex regexVarString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
// VarString (string) pattern
|
||||||
if (false == regexVarString.Match(this.VarString).Success)
|
Regex regexVarString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||||
{
|
if (!regexVarString.Match(this.VarString).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarString, must match a pattern of " + regexVarString, new [] { "VarString" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarString, must match a pattern of " + regexVarString, new [] { "VarString" });
|
||||||
|
} }
|
||||||
|
|
||||||
// UnsignedInteger (uint) maximum
|
// UnsignedInteger (uint) maximum
|
||||||
if (this.UnsignedInteger > (uint)200)
|
if (this.UnsignedInteger > (uint)200)
|
||||||
|
@ -105,12 +105,10 @@ namespace Org.OpenAPITools.Model
|
|||||||
{
|
{
|
||||||
// UuidWithPattern (Guid) pattern
|
// 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)
|
if (!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" });
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });
|
||||||
}
|
} yield break;
|
||||||
|
|
||||||
yield break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,19 +83,21 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <returns>Validation Result</returns>
|
/// <returns>Validation Result</returns>
|
||||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
{
|
{
|
||||||
// Cultivar (string) pattern
|
if (this.Cultivar != null) {
|
||||||
Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant);
|
// Cultivar (string) pattern
|
||||||
if (false == regexCultivar.Match(this.Cultivar).Success)
|
Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant);
|
||||||
{
|
if (!regexCultivar.Match(this.Cultivar).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
|
||||||
|
} }
|
||||||
|
|
||||||
// Origin (string) pattern
|
if (this.Origin != null) {
|
||||||
Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
// Origin (string) pattern
|
||||||
if (false == regexOrigin.Match(this.Origin).Success)
|
Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||||
{
|
if (!regexOrigin.Match(this.Origin).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });
|
||||||
|
} }
|
||||||
|
|
||||||
yield break;
|
yield break;
|
||||||
}
|
}
|
||||||
|
@ -314,33 +314,37 @@ namespace Org.OpenAPITools.Model
|
|||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" });
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" });
|
||||||
}
|
}
|
||||||
|
|
||||||
// PatternWithBackslash (string) pattern
|
if (this.PatternWithBackslash != null) {
|
||||||
Regex regexPatternWithBackslash = new Regex(@"^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", RegexOptions.CultureInvariant);
|
// PatternWithBackslash (string) pattern
|
||||||
if (false == regexPatternWithBackslash.Match(this.PatternWithBackslash).Success)
|
Regex regexPatternWithBackslash = new Regex(@"^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", RegexOptions.CultureInvariant);
|
||||||
{
|
if (!regexPatternWithBackslash.Match(this.PatternWithBackslash).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" });
|
||||||
|
} }
|
||||||
|
|
||||||
// PatternWithDigits (string) pattern
|
if (this.PatternWithDigits != null) {
|
||||||
Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant);
|
// PatternWithDigits (string) pattern
|
||||||
if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success)
|
Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant);
|
||||||
{
|
if (!regexPatternWithDigits.Match(this.PatternWithDigits).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
|
||||||
|
} }
|
||||||
|
|
||||||
// PatternWithDigitsAndDelimiter (string) pattern
|
if (this.PatternWithDigitsAndDelimiter != null) {
|
||||||
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
// PatternWithDigitsAndDelimiter (string) pattern
|
||||||
if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
|
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||||
{
|
if (!regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
|
||||||
|
} }
|
||||||
|
|
||||||
// VarString (string) pattern
|
if (this.VarString != null) {
|
||||||
Regex regexVarString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
// VarString (string) pattern
|
||||||
if (false == regexVarString.Match(this.VarString).Success)
|
Regex regexVarString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||||
{
|
if (!regexVarString.Match(this.VarString).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarString, must match a pattern of " + regexVarString, new [] { "VarString" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarString, must match a pattern of " + regexVarString, new [] { "VarString" });
|
||||||
|
} }
|
||||||
|
|
||||||
// UnsignedInteger (uint) maximum
|
// UnsignedInteger (uint) maximum
|
||||||
if (this.UnsignedInteger > (uint)200)
|
if (this.UnsignedInteger > (uint)200)
|
||||||
|
@ -103,12 +103,10 @@ namespace Org.OpenAPITools.Model
|
|||||||
{
|
{
|
||||||
// UuidWithPattern (Guid) pattern
|
// 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)
|
if (!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" });
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });
|
||||||
}
|
} yield break;
|
||||||
|
|
||||||
yield break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,19 +83,21 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <returns>Validation Result</returns>
|
/// <returns>Validation Result</returns>
|
||||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
{
|
{
|
||||||
// Cultivar (string) pattern
|
if (this.Cultivar != null) {
|
||||||
Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant);
|
// Cultivar (string) pattern
|
||||||
if (false == regexCultivar.Match(this.Cultivar).Success)
|
Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant);
|
||||||
{
|
if (!regexCultivar.Match(this.Cultivar).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
|
||||||
|
} }
|
||||||
|
|
||||||
// Origin (string) pattern
|
if (this.Origin != null) {
|
||||||
Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
// Origin (string) pattern
|
||||||
if (false == regexOrigin.Match(this.Origin).Success)
|
Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||||
{
|
if (!regexOrigin.Match(this.Origin).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });
|
||||||
|
} }
|
||||||
|
|
||||||
yield break;
|
yield break;
|
||||||
}
|
}
|
||||||
|
@ -314,33 +314,37 @@ namespace Org.OpenAPITools.Model
|
|||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" });
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" });
|
||||||
}
|
}
|
||||||
|
|
||||||
// PatternWithBackslash (string) pattern
|
if (this.PatternWithBackslash != null) {
|
||||||
Regex regexPatternWithBackslash = new Regex(@"^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", RegexOptions.CultureInvariant);
|
// PatternWithBackslash (string) pattern
|
||||||
if (false == regexPatternWithBackslash.Match(this.PatternWithBackslash).Success)
|
Regex regexPatternWithBackslash = new Regex(@"^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", RegexOptions.CultureInvariant);
|
||||||
{
|
if (!regexPatternWithBackslash.Match(this.PatternWithBackslash).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" });
|
||||||
|
} }
|
||||||
|
|
||||||
// PatternWithDigits (string) pattern
|
if (this.PatternWithDigits != null) {
|
||||||
Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant);
|
// PatternWithDigits (string) pattern
|
||||||
if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success)
|
Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant);
|
||||||
{
|
if (!regexPatternWithDigits.Match(this.PatternWithDigits).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
|
||||||
|
} }
|
||||||
|
|
||||||
// PatternWithDigitsAndDelimiter (string) pattern
|
if (this.PatternWithDigitsAndDelimiter != null) {
|
||||||
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
// PatternWithDigitsAndDelimiter (string) pattern
|
||||||
if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
|
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||||
{
|
if (!regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
|
||||||
|
} }
|
||||||
|
|
||||||
// VarString (string) pattern
|
if (this.VarString != null) {
|
||||||
Regex regexVarString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
// VarString (string) pattern
|
||||||
if (false == regexVarString.Match(this.VarString).Success)
|
Regex regexVarString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||||
{
|
if (!regexVarString.Match(this.VarString).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarString, must match a pattern of " + regexVarString, new [] { "VarString" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarString, must match a pattern of " + regexVarString, new [] { "VarString" });
|
||||||
|
} }
|
||||||
|
|
||||||
// UnsignedInteger (uint) maximum
|
// UnsignedInteger (uint) maximum
|
||||||
if (this.UnsignedInteger > (uint)200)
|
if (this.UnsignedInteger > (uint)200)
|
||||||
|
@ -103,12 +103,10 @@ namespace Org.OpenAPITools.Model
|
|||||||
{
|
{
|
||||||
// UuidWithPattern (Guid) pattern
|
// 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)
|
if (!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" });
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });
|
||||||
}
|
} yield break;
|
||||||
|
|
||||||
yield break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,19 +139,21 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <returns>Validation Result</returns>
|
/// <returns>Validation Result</returns>
|
||||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
{
|
{
|
||||||
// Cultivar (string) pattern
|
if (this.Cultivar != null) {
|
||||||
Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant);
|
// Cultivar (string) pattern
|
||||||
if (false == regexCultivar.Match(this.Cultivar).Success)
|
Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant);
|
||||||
{
|
if (!regexCultivar.Match(this.Cultivar).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
|
||||||
|
} }
|
||||||
|
|
||||||
// Origin (string) pattern
|
if (this.Origin != null) {
|
||||||
Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
// Origin (string) pattern
|
||||||
if (false == regexOrigin.Match(this.Origin).Success)
|
Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||||
{
|
if (!regexOrigin.Match(this.Origin).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });
|
||||||
|
} }
|
||||||
|
|
||||||
yield break;
|
yield break;
|
||||||
}
|
}
|
||||||
|
@ -430,12 +430,13 @@ namespace Org.OpenAPITools.Model
|
|||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarDouble, must be a value greater than or equal to 67.8.", new [] { "VarDouble" });
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarDouble, must be a value greater than or equal to 67.8.", new [] { "VarDouble" });
|
||||||
}
|
}
|
||||||
|
|
||||||
// VarString (string) pattern
|
if (this.VarString != null) {
|
||||||
Regex regexVarString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
// VarString (string) pattern
|
||||||
if (false == regexVarString.Match(this.VarString).Success)
|
Regex regexVarString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||||
{
|
if (!regexVarString.Match(this.VarString).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarString, must match a pattern of " + regexVarString, new [] { "VarString" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarString, must match a pattern of " + regexVarString, new [] { "VarString" });
|
||||||
|
} }
|
||||||
|
|
||||||
// Password (string) maxLength
|
// Password (string) maxLength
|
||||||
if (this.Password != null && this.Password.Length > 64)
|
if (this.Password != null && this.Password.Length > 64)
|
||||||
@ -449,26 +450,29 @@ namespace Org.OpenAPITools.Model
|
|||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" });
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" });
|
||||||
}
|
}
|
||||||
|
|
||||||
// PatternWithDigits (string) pattern
|
if (this.PatternWithDigits != null) {
|
||||||
Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant);
|
// PatternWithDigits (string) pattern
|
||||||
if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success)
|
Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant);
|
||||||
{
|
if (!regexPatternWithDigits.Match(this.PatternWithDigits).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
|
||||||
|
} }
|
||||||
|
|
||||||
// PatternWithDigitsAndDelimiter (string) pattern
|
if (this.PatternWithDigitsAndDelimiter != null) {
|
||||||
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
// PatternWithDigitsAndDelimiter (string) pattern
|
||||||
if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
|
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||||
{
|
if (!regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
|
||||||
|
} }
|
||||||
|
|
||||||
// PatternWithBackslash (string) pattern
|
if (this.PatternWithBackslash != null) {
|
||||||
Regex regexPatternWithBackslash = new Regex(@"^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", RegexOptions.CultureInvariant);
|
// PatternWithBackslash (string) pattern
|
||||||
if (false == regexPatternWithBackslash.Match(this.PatternWithBackslash).Success)
|
Regex regexPatternWithBackslash = new Regex(@"^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", RegexOptions.CultureInvariant);
|
||||||
{
|
if (!regexPatternWithBackslash.Match(this.PatternWithBackslash).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" });
|
||||||
|
} }
|
||||||
|
|
||||||
yield break;
|
yield break;
|
||||||
}
|
}
|
||||||
|
@ -165,12 +165,13 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <returns>Validation Result</returns>
|
/// <returns>Validation Result</returns>
|
||||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
{
|
{
|
||||||
// UuidWithPattern (Guid) pattern
|
if (this.UuidWithPattern != null) {
|
||||||
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);
|
// UuidWithPattern (Guid) pattern
|
||||||
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
|
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 (!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" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });
|
||||||
|
} }
|
||||||
|
|
||||||
yield break;
|
yield break;
|
||||||
}
|
}
|
||||||
|
@ -138,19 +138,21 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <returns>Validation Result</returns>
|
/// <returns>Validation Result</returns>
|
||||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
{
|
{
|
||||||
// Cultivar (string) pattern
|
if (this.Cultivar != null) {
|
||||||
Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant);
|
// Cultivar (string) pattern
|
||||||
if (false == regexCultivar.Match(this.Cultivar).Success)
|
Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant);
|
||||||
{
|
if (!regexCultivar.Match(this.Cultivar).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
|
||||||
|
} }
|
||||||
|
|
||||||
// Origin (string) pattern
|
if (this.Origin != null) {
|
||||||
Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
// Origin (string) pattern
|
||||||
if (false == regexOrigin.Match(this.Origin).Success)
|
Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||||
{
|
if (!regexOrigin.Match(this.Origin).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });
|
||||||
|
} }
|
||||||
|
|
||||||
yield break;
|
yield break;
|
||||||
}
|
}
|
||||||
|
@ -429,12 +429,13 @@ namespace Org.OpenAPITools.Model
|
|||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarDouble, must be a value greater than or equal to 67.8.", new [] { "VarDouble" });
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarDouble, must be a value greater than or equal to 67.8.", new [] { "VarDouble" });
|
||||||
}
|
}
|
||||||
|
|
||||||
// VarString (string) pattern
|
if (this.VarString != null) {
|
||||||
Regex regexVarString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
// VarString (string) pattern
|
||||||
if (false == regexVarString.Match(this.VarString).Success)
|
Regex regexVarString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||||
{
|
if (!regexVarString.Match(this.VarString).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarString, must match a pattern of " + regexVarString, new [] { "VarString" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarString, must match a pattern of " + regexVarString, new [] { "VarString" });
|
||||||
|
} }
|
||||||
|
|
||||||
// Password (string) maxLength
|
// Password (string) maxLength
|
||||||
if (this.Password != null && this.Password.Length > 64)
|
if (this.Password != null && this.Password.Length > 64)
|
||||||
@ -448,26 +449,29 @@ namespace Org.OpenAPITools.Model
|
|||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" });
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" });
|
||||||
}
|
}
|
||||||
|
|
||||||
// PatternWithDigits (string) pattern
|
if (this.PatternWithDigits != null) {
|
||||||
Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant);
|
// PatternWithDigits (string) pattern
|
||||||
if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success)
|
Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant);
|
||||||
{
|
if (!regexPatternWithDigits.Match(this.PatternWithDigits).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
|
||||||
|
} }
|
||||||
|
|
||||||
// PatternWithDigitsAndDelimiter (string) pattern
|
if (this.PatternWithDigitsAndDelimiter != null) {
|
||||||
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
// PatternWithDigitsAndDelimiter (string) pattern
|
||||||
if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
|
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||||
{
|
if (!regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
|
||||||
|
} }
|
||||||
|
|
||||||
// PatternWithBackslash (string) pattern
|
if (this.PatternWithBackslash != null) {
|
||||||
Regex regexPatternWithBackslash = new Regex(@"^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", RegexOptions.CultureInvariant);
|
// PatternWithBackslash (string) pattern
|
||||||
if (false == regexPatternWithBackslash.Match(this.PatternWithBackslash).Success)
|
Regex regexPatternWithBackslash = new Regex(@"^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", RegexOptions.CultureInvariant);
|
||||||
{
|
if (!regexPatternWithBackslash.Match(this.PatternWithBackslash).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" });
|
||||||
|
} }
|
||||||
|
|
||||||
yield break;
|
yield break;
|
||||||
}
|
}
|
||||||
|
@ -164,12 +164,13 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <returns>Validation Result</returns>
|
/// <returns>Validation Result</returns>
|
||||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
{
|
{
|
||||||
// UuidWithPattern (Guid) pattern
|
if (this.UuidWithPattern != null) {
|
||||||
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);
|
// UuidWithPattern (Guid) pattern
|
||||||
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
|
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 (!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" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });
|
||||||
|
} }
|
||||||
|
|
||||||
yield break;
|
yield break;
|
||||||
}
|
}
|
||||||
|
@ -138,19 +138,21 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <returns>Validation Result</returns>
|
/// <returns>Validation Result</returns>
|
||||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
{
|
{
|
||||||
// Cultivar (string) pattern
|
if (this.Cultivar != null) {
|
||||||
Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant);
|
// Cultivar (string) pattern
|
||||||
if (false == regexCultivar.Match(this.Cultivar).Success)
|
Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant);
|
||||||
{
|
if (!regexCultivar.Match(this.Cultivar).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
|
||||||
|
} }
|
||||||
|
|
||||||
// Origin (string) pattern
|
if (this.Origin != null) {
|
||||||
Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
// Origin (string) pattern
|
||||||
if (false == regexOrigin.Match(this.Origin).Success)
|
Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||||
{
|
if (!regexOrigin.Match(this.Origin).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });
|
||||||
|
} }
|
||||||
|
|
||||||
yield break;
|
yield break;
|
||||||
}
|
}
|
||||||
|
@ -429,12 +429,13 @@ namespace Org.OpenAPITools.Model
|
|||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarDouble, must be a value greater than or equal to 67.8.", new [] { "VarDouble" });
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarDouble, must be a value greater than or equal to 67.8.", new [] { "VarDouble" });
|
||||||
}
|
}
|
||||||
|
|
||||||
// VarString (string) pattern
|
if (this.VarString != null) {
|
||||||
Regex regexVarString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
// VarString (string) pattern
|
||||||
if (false == regexVarString.Match(this.VarString).Success)
|
Regex regexVarString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||||
{
|
if (!regexVarString.Match(this.VarString).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarString, must match a pattern of " + regexVarString, new [] { "VarString" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarString, must match a pattern of " + regexVarString, new [] { "VarString" });
|
||||||
|
} }
|
||||||
|
|
||||||
// Password (string) maxLength
|
// Password (string) maxLength
|
||||||
if (this.Password != null && this.Password.Length > 64)
|
if (this.Password != null && this.Password.Length > 64)
|
||||||
@ -448,26 +449,29 @@ namespace Org.OpenAPITools.Model
|
|||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" });
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" });
|
||||||
}
|
}
|
||||||
|
|
||||||
// PatternWithDigits (string) pattern
|
if (this.PatternWithDigits != null) {
|
||||||
Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant);
|
// PatternWithDigits (string) pattern
|
||||||
if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success)
|
Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant);
|
||||||
{
|
if (!regexPatternWithDigits.Match(this.PatternWithDigits).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
|
||||||
|
} }
|
||||||
|
|
||||||
// PatternWithDigitsAndDelimiter (string) pattern
|
if (this.PatternWithDigitsAndDelimiter != null) {
|
||||||
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
// PatternWithDigitsAndDelimiter (string) pattern
|
||||||
if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
|
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||||
{
|
if (!regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
|
||||||
|
} }
|
||||||
|
|
||||||
// PatternWithBackslash (string) pattern
|
if (this.PatternWithBackslash != null) {
|
||||||
Regex regexPatternWithBackslash = new Regex(@"^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", RegexOptions.CultureInvariant);
|
// PatternWithBackslash (string) pattern
|
||||||
if (false == regexPatternWithBackslash.Match(this.PatternWithBackslash).Success)
|
Regex regexPatternWithBackslash = new Regex(@"^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", RegexOptions.CultureInvariant);
|
||||||
{
|
if (!regexPatternWithBackslash.Match(this.PatternWithBackslash).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" });
|
||||||
|
} }
|
||||||
|
|
||||||
yield break;
|
yield break;
|
||||||
}
|
}
|
||||||
|
@ -164,12 +164,13 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <returns>Validation Result</returns>
|
/// <returns>Validation Result</returns>
|
||||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
{
|
{
|
||||||
// UuidWithPattern (Guid) pattern
|
if (this.UuidWithPattern != null) {
|
||||||
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);
|
// UuidWithPattern (Guid) pattern
|
||||||
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
|
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 (!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" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });
|
||||||
|
} }
|
||||||
|
|
||||||
yield break;
|
yield break;
|
||||||
}
|
}
|
||||||
|
@ -138,19 +138,21 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <returns>Validation Result</returns>
|
/// <returns>Validation Result</returns>
|
||||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
{
|
{
|
||||||
// Cultivar (string) pattern
|
if (this.Cultivar != null) {
|
||||||
Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant);
|
// Cultivar (string) pattern
|
||||||
if (false == regexCultivar.Match(this.Cultivar).Success)
|
Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant);
|
||||||
{
|
if (!regexCultivar.Match(this.Cultivar).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
|
||||||
|
} }
|
||||||
|
|
||||||
// Origin (string) pattern
|
if (this.Origin != null) {
|
||||||
Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
// Origin (string) pattern
|
||||||
if (false == regexOrigin.Match(this.Origin).Success)
|
Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||||
{
|
if (!regexOrigin.Match(this.Origin).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });
|
||||||
|
} }
|
||||||
|
|
||||||
yield break;
|
yield break;
|
||||||
}
|
}
|
||||||
|
@ -429,12 +429,13 @@ namespace Org.OpenAPITools.Model
|
|||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarDouble, must be a value greater than or equal to 67.8.", new [] { "VarDouble" });
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarDouble, must be a value greater than or equal to 67.8.", new [] { "VarDouble" });
|
||||||
}
|
}
|
||||||
|
|
||||||
// VarString (string) pattern
|
if (this.VarString != null) {
|
||||||
Regex regexVarString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
// VarString (string) pattern
|
||||||
if (false == regexVarString.Match(this.VarString).Success)
|
Regex regexVarString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||||
{
|
if (!regexVarString.Match(this.VarString).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarString, must match a pattern of " + regexVarString, new [] { "VarString" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarString, must match a pattern of " + regexVarString, new [] { "VarString" });
|
||||||
|
} }
|
||||||
|
|
||||||
// Password (string) maxLength
|
// Password (string) maxLength
|
||||||
if (this.Password != null && this.Password.Length > 64)
|
if (this.Password != null && this.Password.Length > 64)
|
||||||
@ -448,26 +449,29 @@ namespace Org.OpenAPITools.Model
|
|||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" });
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" });
|
||||||
}
|
}
|
||||||
|
|
||||||
// PatternWithDigits (string) pattern
|
if (this.PatternWithDigits != null) {
|
||||||
Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant);
|
// PatternWithDigits (string) pattern
|
||||||
if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success)
|
Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant);
|
||||||
{
|
if (!regexPatternWithDigits.Match(this.PatternWithDigits).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
|
||||||
|
} }
|
||||||
|
|
||||||
// PatternWithDigitsAndDelimiter (string) pattern
|
if (this.PatternWithDigitsAndDelimiter != null) {
|
||||||
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
// PatternWithDigitsAndDelimiter (string) pattern
|
||||||
if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
|
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||||
{
|
if (!regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
|
||||||
|
} }
|
||||||
|
|
||||||
// PatternWithBackslash (string) pattern
|
if (this.PatternWithBackslash != null) {
|
||||||
Regex regexPatternWithBackslash = new Regex(@"^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", RegexOptions.CultureInvariant);
|
// PatternWithBackslash (string) pattern
|
||||||
if (false == regexPatternWithBackslash.Match(this.PatternWithBackslash).Success)
|
Regex regexPatternWithBackslash = new Regex(@"^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", RegexOptions.CultureInvariant);
|
||||||
{
|
if (!regexPatternWithBackslash.Match(this.PatternWithBackslash).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" });
|
||||||
|
} }
|
||||||
|
|
||||||
yield break;
|
yield break;
|
||||||
}
|
}
|
||||||
|
@ -164,12 +164,13 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <returns>Validation Result</returns>
|
/// <returns>Validation Result</returns>
|
||||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
{
|
{
|
||||||
// UuidWithPattern (Guid) pattern
|
if (this.UuidWithPattern != null) {
|
||||||
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);
|
// UuidWithPattern (Guid) pattern
|
||||||
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
|
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 (!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" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });
|
||||||
|
} }
|
||||||
|
|
||||||
yield break;
|
yield break;
|
||||||
}
|
}
|
||||||
|
@ -138,19 +138,21 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <returns>Validation Result</returns>
|
/// <returns>Validation Result</returns>
|
||||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
{
|
{
|
||||||
// Cultivar (string) pattern
|
if (this.Cultivar != null) {
|
||||||
Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant);
|
// Cultivar (string) pattern
|
||||||
if (false == regexCultivar.Match(this.Cultivar).Success)
|
Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant);
|
||||||
{
|
if (!regexCultivar.Match(this.Cultivar).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
|
||||||
|
} }
|
||||||
|
|
||||||
// Origin (string) pattern
|
if (this.Origin != null) {
|
||||||
Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
// Origin (string) pattern
|
||||||
if (false == regexOrigin.Match(this.Origin).Success)
|
Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||||
{
|
if (!regexOrigin.Match(this.Origin).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });
|
||||||
|
} }
|
||||||
|
|
||||||
yield break;
|
yield break;
|
||||||
}
|
}
|
||||||
|
@ -429,12 +429,13 @@ namespace Org.OpenAPITools.Model
|
|||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarDouble, must be a value greater than or equal to 67.8.", new [] { "VarDouble" });
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarDouble, must be a value greater than or equal to 67.8.", new [] { "VarDouble" });
|
||||||
}
|
}
|
||||||
|
|
||||||
// VarString (string) pattern
|
if (this.VarString != null) {
|
||||||
Regex regexVarString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
// VarString (string) pattern
|
||||||
if (false == regexVarString.Match(this.VarString).Success)
|
Regex regexVarString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||||
{
|
if (!regexVarString.Match(this.VarString).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarString, must match a pattern of " + regexVarString, new [] { "VarString" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarString, must match a pattern of " + regexVarString, new [] { "VarString" });
|
||||||
|
} }
|
||||||
|
|
||||||
// Password (string) maxLength
|
// Password (string) maxLength
|
||||||
if (this.Password != null && this.Password.Length > 64)
|
if (this.Password != null && this.Password.Length > 64)
|
||||||
@ -448,26 +449,29 @@ namespace Org.OpenAPITools.Model
|
|||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" });
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" });
|
||||||
}
|
}
|
||||||
|
|
||||||
// PatternWithDigits (string) pattern
|
if (this.PatternWithDigits != null) {
|
||||||
Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant);
|
// PatternWithDigits (string) pattern
|
||||||
if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success)
|
Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant);
|
||||||
{
|
if (!regexPatternWithDigits.Match(this.PatternWithDigits).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
|
||||||
|
} }
|
||||||
|
|
||||||
// PatternWithDigitsAndDelimiter (string) pattern
|
if (this.PatternWithDigitsAndDelimiter != null) {
|
||||||
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
// PatternWithDigitsAndDelimiter (string) pattern
|
||||||
if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
|
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||||
{
|
if (!regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
|
||||||
|
} }
|
||||||
|
|
||||||
// PatternWithBackslash (string) pattern
|
if (this.PatternWithBackslash != null) {
|
||||||
Regex regexPatternWithBackslash = new Regex(@"^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", RegexOptions.CultureInvariant);
|
// PatternWithBackslash (string) pattern
|
||||||
if (false == regexPatternWithBackslash.Match(this.PatternWithBackslash).Success)
|
Regex regexPatternWithBackslash = new Regex(@"^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", RegexOptions.CultureInvariant);
|
||||||
{
|
if (!regexPatternWithBackslash.Match(this.PatternWithBackslash).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" });
|
||||||
|
} }
|
||||||
|
|
||||||
yield break;
|
yield break;
|
||||||
}
|
}
|
||||||
|
@ -164,12 +164,13 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <returns>Validation Result</returns>
|
/// <returns>Validation Result</returns>
|
||||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
{
|
{
|
||||||
// UuidWithPattern (Guid) pattern
|
if (this.UuidWithPattern != null) {
|
||||||
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);
|
// UuidWithPattern (Guid) pattern
|
||||||
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
|
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 (!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" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });
|
||||||
|
} }
|
||||||
|
|
||||||
yield break;
|
yield break;
|
||||||
}
|
}
|
||||||
|
@ -126,19 +126,21 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <returns>Validation Result</returns>
|
/// <returns>Validation Result</returns>
|
||||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
{
|
{
|
||||||
// Cultivar (string) pattern
|
if (this.Cultivar != null) {
|
||||||
Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant);
|
// Cultivar (string) pattern
|
||||||
if (false == regexCultivar.Match(this.Cultivar).Success)
|
Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant);
|
||||||
{
|
if (!regexCultivar.Match(this.Cultivar).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
|
||||||
|
} }
|
||||||
|
|
||||||
// Origin (string) pattern
|
if (this.Origin != null) {
|
||||||
Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
// Origin (string) pattern
|
||||||
if (false == regexOrigin.Match(this.Origin).Success)
|
Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||||
{
|
if (!regexOrigin.Match(this.Origin).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });
|
||||||
|
} }
|
||||||
|
|
||||||
yield break;
|
yield break;
|
||||||
}
|
}
|
||||||
|
@ -414,12 +414,13 @@ namespace Org.OpenAPITools.Model
|
|||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarDouble, must be a value greater than or equal to 67.8.", new [] { "VarDouble" });
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarDouble, must be a value greater than or equal to 67.8.", new [] { "VarDouble" });
|
||||||
}
|
}
|
||||||
|
|
||||||
// VarString (string) pattern
|
if (this.VarString != null) {
|
||||||
Regex regexVarString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
// VarString (string) pattern
|
||||||
if (false == regexVarString.Match(this.VarString).Success)
|
Regex regexVarString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||||
{
|
if (!regexVarString.Match(this.VarString).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarString, must match a pattern of " + regexVarString, new [] { "VarString" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarString, must match a pattern of " + regexVarString, new [] { "VarString" });
|
||||||
|
} }
|
||||||
|
|
||||||
// Password (string) maxLength
|
// Password (string) maxLength
|
||||||
if (this.Password != null && this.Password.Length > 64)
|
if (this.Password != null && this.Password.Length > 64)
|
||||||
@ -433,26 +434,29 @@ namespace Org.OpenAPITools.Model
|
|||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" });
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" });
|
||||||
}
|
}
|
||||||
|
|
||||||
// PatternWithDigits (string) pattern
|
if (this.PatternWithDigits != null) {
|
||||||
Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant);
|
// PatternWithDigits (string) pattern
|
||||||
if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success)
|
Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant);
|
||||||
{
|
if (!regexPatternWithDigits.Match(this.PatternWithDigits).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
|
||||||
|
} }
|
||||||
|
|
||||||
// PatternWithDigitsAndDelimiter (string) pattern
|
if (this.PatternWithDigitsAndDelimiter != null) {
|
||||||
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
// PatternWithDigitsAndDelimiter (string) pattern
|
||||||
if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
|
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||||
{
|
if (!regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
|
||||||
|
} }
|
||||||
|
|
||||||
// PatternWithBackslash (string) pattern
|
if (this.PatternWithBackslash != null) {
|
||||||
Regex regexPatternWithBackslash = new Regex(@"^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", RegexOptions.CultureInvariant);
|
// PatternWithBackslash (string) pattern
|
||||||
if (false == regexPatternWithBackslash.Match(this.PatternWithBackslash).Success)
|
Regex regexPatternWithBackslash = new Regex(@"^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", RegexOptions.CultureInvariant);
|
||||||
{
|
if (!regexPatternWithBackslash.Match(this.PatternWithBackslash).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" });
|
||||||
|
} }
|
||||||
|
|
||||||
yield break;
|
yield break;
|
||||||
}
|
}
|
||||||
|
@ -152,12 +152,13 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <returns>Validation Result</returns>
|
/// <returns>Validation Result</returns>
|
||||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
{
|
{
|
||||||
// UuidWithPattern (Guid) pattern
|
if (this.UuidWithPattern != null) {
|
||||||
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);
|
// UuidWithPattern (Guid) pattern
|
||||||
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
|
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 (!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" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });
|
||||||
|
} }
|
||||||
|
|
||||||
yield break;
|
yield break;
|
||||||
}
|
}
|
||||||
|
@ -123,12 +123,13 @@ namespace Org.OpenAPITools.Model
|
|||||||
/// <returns>Validation Result</returns>
|
/// <returns>Validation Result</returns>
|
||||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||||
{
|
{
|
||||||
// Name (string) pattern
|
if (this.Name != null) {
|
||||||
Regex regexName = new Regex(@"^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$", RegexOptions.CultureInvariant);
|
// Name (string) pattern
|
||||||
if (false == regexName.Match(this.Name).Success)
|
Regex regexName = new Regex(@"^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$", RegexOptions.CultureInvariant);
|
||||||
{
|
if (!regexName.Match(this.Name).Success)
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Name, must match a pattern of " + regexName, new [] { "Name" });
|
{
|
||||||
}
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Name, must match a pattern of " + regexName, new [] { "Name" });
|
||||||
|
} }
|
||||||
|
|
||||||
yield break;
|
yield break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user