forked from loafle/openapi-generator-original
Merge branch 'master' of https://github.com/swagger-api/swagger-codegen
This commit is contained in:
commit
2a5913c0dd
@ -241,13 +241,15 @@ this.{{name}} = {{name}};
|
|||||||
|
|
||||||
{{/minimum}}
|
{{/minimum}}
|
||||||
{{#pattern}}
|
{{#pattern}}
|
||||||
|
{{^isByteArray}}
|
||||||
// {{{name}}} ({{{datatype}}}) pattern
|
// {{{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}}}).Success)
|
if (false == regex{{{name}}}.Match(this.{{{name}}}).Success)
|
||||||
{
|
{
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, must match a pattern of {{{pattern}}}.", new [] { "{{{name}}}" });
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, must match a pattern of " + regex{{{name}}}, new [] { "{{{name}}}" });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{{/isByteArray}}
|
||||||
{{/pattern}}
|
{{/pattern}}
|
||||||
{{/hasValidation}}
|
{{/hasValidation}}
|
||||||
{{/vars}}
|
{{/vars}}
|
||||||
|
@ -415,7 +415,7 @@ namespace IO.Swagger.Model
|
|||||||
Regex regex_String = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
Regex regex_String = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||||
if (false == regex_String.Match(this._String).Success)
|
if (false == regex_String.Match(this._String).Success)
|
||||||
{
|
{
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _String, must match a pattern of /[a-z]/i.", new [] { "_String" });
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _String, must match a pattern of " + regex_String, new [] { "_String" });
|
||||||
}
|
}
|
||||||
|
|
||||||
// _Byte (byte[]) pattern
|
// _Byte (byte[]) pattern
|
||||||
|
@ -438,7 +438,7 @@ namespace IO.Swagger.Model
|
|||||||
Regex regex_String = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
Regex regex_String = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||||
if (false == regex_String.Match(this._String).Success)
|
if (false == regex_String.Match(this._String).Success)
|
||||||
{
|
{
|
||||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _String, must match a pattern of /[a-z]/i.", new [] { "_String" });
|
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for _String, must match a pattern of " + regex_String, new [] { "_String" });
|
||||||
}
|
}
|
||||||
|
|
||||||
// _Byte (byte[]) pattern
|
// _Byte (byte[]) pattern
|
||||||
|
Loading…
x
Reference in New Issue
Block a user