[csharp-netcore] Better regular expression (#15378)

* do not escape regular expression in c#

* update samples

* better code format
This commit is contained in:
William Cheng
2023-05-04 18:42:30 +08:00
committed by GitHub
parent 6fa089adee
commit 182240ea1d
76 changed files with 471 additions and 124 deletions

View File

@@ -506,40 +506,40 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
// https://github.com/OpenAPITools/openapi-generator/issues/12324
// TODO: why do these collections contain different instances?
// fixing allVars should suffice instead of patching every collection
for (CodegenProperty property : model.allVars){
for (CodegenProperty property : model.allVars) {
patchProperty(model, property);
}
for (CodegenProperty property : model.vars){
for (CodegenProperty property : model.vars) {
patchProperty(model, property);
}
for (CodegenProperty property : model.readWriteVars){
for (CodegenProperty property : model.readWriteVars) {
patchProperty(model, property);
}
for (CodegenProperty property : model.optionalVars){
for (CodegenProperty property : model.optionalVars) {
patchProperty(model, property);
}
for (CodegenProperty property : model.parentVars){
for (CodegenProperty property : model.parentVars) {
patchProperty(model, property);
}
for (CodegenProperty property : model.requiredVars){
for (CodegenProperty property : model.requiredVars) {
patchProperty(model, property);
}
for (CodegenProperty property : model.readOnlyVars){
for (CodegenProperty property : model.readOnlyVars) {
patchProperty(model, property);
}
for (CodegenProperty property : model.nonNullableVars){
for (CodegenProperty property : model.nonNullableVars) {
patchProperty(model, property);
}
}
return processed;
}
private void patchProperty(CodegenModel model, CodegenProperty property){
private void patchProperty(CodegenModel model, CodegenProperty property) {
/**
* Hotfix for this issue
* https://github.com/OpenAPITools/openapi-generator/issues/12155
*/
if (property.dataType.equals("List") && property.getComposedSchemas() != null && property.getComposedSchemas().getAllOf() != null){
* Hotfix for this issue
* https://github.com/OpenAPITools/openapi-generator/issues/12155
*/
if (property.dataType.equals("List") && property.getComposedSchemas() != null && property.getComposedSchemas().getAllOf() != null) {
List<CodegenProperty> composedSchemas = property.getComposedSchemas().getAllOf();
if (composedSchemas.size() == 0) {
return;
@@ -567,26 +567,28 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
}
}
/** Mitigates https://github.com/OpenAPITools/openapi-generator/issues/13709 */
/**
* Mitigates https://github.com/OpenAPITools/openapi-generator/issues/13709
*/
private void removeCircularReferencesInComposedSchemas(CodegenModel cm) {
cm.anyOf.removeIf(anyOf -> anyOf.equals(cm.classname));
cm.oneOf.removeIf(oneOf -> oneOf.equals(cm.classname));
cm.allOf.removeIf(allOf -> allOf.equals(cm.classname));
CodegenComposedSchemas composedSchemas = cm.getComposedSchemas();
if (composedSchemas != null){
if (composedSchemas != null) {
List<CodegenProperty> anyOf = composedSchemas.getAnyOf();
if (anyOf != null) {
anyOf.removeIf(p -> p.dataType.equals(cm.classname));
}
List<CodegenProperty> oneOf = composedSchemas.getOneOf();
if (oneOf != null){
if (oneOf != null) {
oneOf.removeIf(p -> p.dataType.equals(cm.classname));
}
List<CodegenProperty> allOf = composedSchemas.getAllOf();
if (allOf != null){
if (allOf != null) {
allOf.removeIf(p -> p.dataType.equals(cm.classname));
}
}
@@ -599,7 +601,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
// this is needed for enumRefs like OuterEnum marked as nullable and also have string values
// keep isString true so that the index will be used as the enum value instead of a string
// this is inline with C# enums with string values
if ("string?".equals(dataType)){
if ("string?".equals(dataType)) {
enumVars.forEach((enumVar) -> {
enumVar.put("isString", true);
});
@@ -1086,6 +1088,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
/**
* Return the default value of the property
*
* @param p OpenAPI property object
* @return string presentation of the default value of the property
*/
@@ -1272,9 +1275,13 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
return toModelName(name) + "Tests";
}
public void setLicenseUrl(String licenseUrl) {this.licenseUrl = licenseUrl;}
public void setLicenseUrl(String licenseUrl) {
this.licenseUrl = licenseUrl;
}
public void setLicenseName(String licenseName) {this.licenseName = licenseName;}
public void setLicenseName(String licenseName) {
this.licenseName = licenseName;
}
public void setPackageName(String packageName) {
this.packageName = packageName;
@@ -1328,12 +1335,12 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
return interfacePrefix;
}
public void setNullableReferenceTypes(final Boolean nullReferenceTypesFlag){
public void setNullableReferenceTypes(final Boolean nullReferenceTypesFlag) {
this.nullReferenceTypesFlag = nullReferenceTypesFlag;
additionalProperties.put("nullableReferenceTypes", nullReferenceTypesFlag);
additionalProperties.put("nrt", nullReferenceTypesFlag);
if (nullReferenceTypesFlag){
if (nullReferenceTypesFlag) {
additionalProperties.put("nrt?", "?");
additionalProperties.put("nrt!", "!");
} else {
@@ -1342,7 +1349,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
}
}
public boolean getNullableReferencesTypes(){
public boolean getNullableReferencesTypes() {
return this.nullReferenceTypesFlag;
}
@@ -1442,7 +1449,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
*/
protected boolean isValueType(CodegenProperty var) {
return (valueTypes.contains(var.dataType) || var.isEnum ) ;
return (valueTypes.contains(var.dataType) || var.isEnum);
}
@Override
@@ -1581,8 +1588,8 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
// use isNullable, OptionalParameterLambda, or RequiredParameterLambda
if (!parameter.required && (nullReferenceTypesFlag || nullableType.contains(parameter.dataType))) {
parameter.dataType = parameter.dataType.endsWith("?")
? parameter.dataType
: parameter.dataType + "?";
? parameter.dataType
: parameter.dataType + "?";
}
}
@@ -1617,5 +1624,12 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
}
@Override
public GeneratorLanguage generatorLanguage() { return GeneratorLanguage.C_SHARP; }
public GeneratorLanguage generatorLanguage() {
return GeneratorLanguage.C_SHARP;
}
public String toRegularExpression(String pattern) {
return addRegularExpressionDelimiter(pattern);
}
}

View File

@@ -42,7 +42,7 @@ namespace {{packageName}}.Client
/// <returns>Filename</returns>
public static string SanitizeFilename(string filename)
{
Match match = Regex.Match(filename, ".*[/\\](.*)$");
Match match = Regex.Match(filename, @".*[/\\](.*)$");
return match.Success ? match.Groups[1].Value : filename;
}

View File

@@ -96,7 +96,7 @@ namespace {{packageName}}.{{clientPackage}}
/// <returns>Filename</returns>
public static string SanitizeFilename(string filename)
{
Match match = Regex.Match(filename, ".*[/\\](.*)$");
Match match = Regex.Match(filename, @".*[/\\](.*)$");
return match.Success ? match.Groups[1].Value : filename;
}

View File

@@ -74,7 +74,7 @@
{{#pattern}}
{{^isByteArray}}
// {{{name}}} ({{{dataType}}}) pattern
Regex regex{{{name}}} = new Regex("{{{vendorExtensions.x-regex}}}"{{#vendorExtensions.x-modifiers}}{{#-first}}, {{/-first}}RegexOptions.{{{.}}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}});
Regex regex{{{name}}} = new Regex(@"{{{vendorExtensions.x-regex}}}"{{#vendorExtensions.x-modifiers}}{{#-first}}, {{/-first}}RegexOptions.{{{.}}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}});
if (false == regex{{{name}}}.Match(this.{{{name}}}{{#isUuid}}.ToString(){{/isUuid}}).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for {{{name}}}, must match a pattern of " + regex{{{name}}}, new [] { "{{{name}}}" });

View File

@@ -1571,6 +1571,10 @@ components:
description: A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.
type: string
pattern: '/^image_\d{1,3}$/i'
pattern_with_backslash:
description: None
type: string
pattern: '^(([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]))$'
EnumClass:
type: string
default: '-efg'
@@ -2268,4 +2272,4 @@ components:
default: C:\\Users\\username
unescapedLiteralString:
type: string
default: C:\Users\username
default: C:\Users\username

View File

@@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Client
/// <returns>Filename</returns>
public static string SanitizeFilename(string filename)
{
Match match = Regex.Match(filename, ".*[/\\](.*)$");
Match match = Regex.Match(filename, @".*[/\\](.*)$");
return match.Success ? match.Groups[1].Value : filename;
}

View File

@@ -1497,6 +1497,11 @@ components:
to three digits following i.e. Image_01.
pattern: "/^image_\\d{1,3}$/i"
type: string
pattern_with_backslash:
description: None
pattern: "^(([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]))$"
type: string
required:
- byte
- date

View File

@@ -22,6 +22,7 @@ Name | Type | Description | Notes
**Password** | **string** | |
**PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional]
**PatternWithDigitsAndDelimiter** | **string** | A string starting with &#39;image_&#39; (case insensitive) and one to three digits following i.e. Image_01. | [optional]
**PatternWithBackslash** | **string** | None | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Client
/// <returns>Filename</returns>
public static string SanitizeFilename(string filename)
{
Match match = Regex.Match(filename, ".*[/\\](.*)$");
Match match = Regex.Match(filename, @".*[/\\](.*)$");
return match.Success ? match.Groups[1].Value : filename;
}

View File

@@ -183,14 +183,14 @@ namespace Org.OpenAPITools.Model
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
// Cultivar (string) pattern
Regex regexCultivar = new Regex("^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant);
Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant);
if (false == regexCultivar.Match(this.Cultivar).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
}
// Origin (string) pattern
Regex regexOrigin = new Regex("^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
if (false == regexOrigin.Match(this.Origin).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });

View File

@@ -61,7 +61,8 @@ namespace Org.OpenAPITools.Model
/// <param name="password">password (required).</param>
/// <param name="patternWithDigits">A string that is a 10 digit number. Can have leading zeros..</param>
/// <param name="patternWithDigitsAndDelimiter">A string starting with &#39;image_&#39; (case insensitive) and one to three digits following i.e. Image_01..</param>
public FormatTest(int integer = default(int), int int32 = default(int), uint unsignedInteger = default(uint), long int64 = default(long), ulong unsignedLong = default(ulong), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string))
/// <param name="patternWithBackslash">None.</param>
public FormatTest(int integer = default(int), int int32 = default(int), uint unsignedInteger = default(uint), long int64 = default(long), ulong unsignedLong = default(ulong), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string), string patternWithBackslash = default(string))
{
this._Number = number;
// to ensure "_byte" is required (not null)
@@ -147,6 +148,11 @@ namespace Org.OpenAPITools.Model
{
this._flagPatternWithDigitsAndDelimiter = true;
}
this._PatternWithBackslash = patternWithBackslash;
if (this.PatternWithBackslash != null)
{
this._flagPatternWithBackslash = true;
}
this.AdditionalProperties = new Dictionary<string, object>();
}
@@ -589,6 +595,31 @@ namespace Org.OpenAPITools.Model
return _flagPatternWithDigitsAndDelimiter;
}
/// <summary>
/// None
/// </summary>
/// <value>None</value>
[DataMember(Name = "pattern_with_backslash", EmitDefaultValue = false)]
public string PatternWithBackslash
{
get{ return _PatternWithBackslash;}
set
{
_PatternWithBackslash = value;
_flagPatternWithBackslash = true;
}
}
private string _PatternWithBackslash;
private bool _flagPatternWithBackslash;
/// <summary>
/// Returns false as PatternWithBackslash should not be serialized given that it's read-only.
/// </summary>
/// <returns>false (boolean)</returns>
public bool ShouldSerializePatternWithBackslash()
{
return _flagPatternWithBackslash;
}
/// <summary>
/// Gets or Sets additional properties
/// </summary>
[JsonExtensionData]
@@ -620,6 +651,7 @@ namespace Org.OpenAPITools.Model
sb.Append(" Password: ").Append(Password).Append("\n");
sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n");
sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n");
sb.Append(" PatternWithBackslash: ").Append(PatternWithBackslash).Append("\n");
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
sb.Append("}\n");
return sb.ToString();
@@ -708,6 +740,10 @@ namespace Org.OpenAPITools.Model
{
hashCode = (hashCode * 59) + this.PatternWithDigitsAndDelimiter.GetHashCode();
}
if (this.PatternWithBackslash != null)
{
hashCode = (hashCode * 59) + this.PatternWithBackslash.GetHashCode();
}
if (this.AdditionalProperties != null)
{
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
@@ -796,7 +832,7 @@ namespace Org.OpenAPITools.Model
}
// String (string) pattern
Regex regexString = new Regex("[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
Regex regexString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
if (false == regexString.Match(this.String).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" });
@@ -815,19 +851,26 @@ namespace Org.OpenAPITools.Model
}
// PatternWithDigits (string) pattern
Regex regexPatternWithDigits = new Regex("^\\d{10}$", RegexOptions.CultureInvariant);
Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant);
if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
}
// PatternWithDigitsAndDelimiter (string) pattern
Regex regexPatternWithDigitsAndDelimiter = new Regex("^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
}
// PatternWithBackslash (string) pattern
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 (false == 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 break;
}
}

View File

@@ -253,7 +253,7 @@ namespace Org.OpenAPITools.Model
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
// UuidWithPattern (Guid) pattern
Regex regexUuidWithPattern = new Regex("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });

View File

@@ -1497,6 +1497,11 @@ components:
to three digits following i.e. Image_01.
pattern: "/^image_\\d{1,3}$/i"
type: string
pattern_with_backslash:
description: None
pattern: "^(([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]))$"
type: string
required:
- byte
- date

View File

@@ -16,6 +16,7 @@ Name | Type | Description | Notes
**Integer** | **int** | | [optional]
**Number** | **decimal** | |
**Password** | **string** | |
**PatternWithBackslash** | **string** | None | [optional]
**PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional]
**PatternWithDigitsAndDelimiter** | **string** | A string starting with &#39;image_&#39; (case insensitive) and one to three digits following i.e. Image_01. | [optional]
**StringProperty** | **string** | | [optional]

View File

@@ -100,7 +100,7 @@ namespace Org.OpenAPITools.Client
/// <returns>Filename</returns>
public static string SanitizeFilename(string filename)
{
Match match = Regex.Match(filename, ".*[/\\](.*)$");
Match match = Regex.Match(filename, @".*[/\\](.*)$");
return match.Success ? match.Groups[1].Value : filename;
}

View File

@@ -83,14 +83,14 @@ namespace Org.OpenAPITools.Model
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
// Cultivar (string) pattern
Regex regexCultivar = new Regex("^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant);
Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant);
if (false == regexCultivar.Match(this.Cultivar).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
}
// Origin (string) pattern
Regex regexOrigin = new Regex("^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
if (false == regexOrigin.Match(this.Origin).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });

View File

@@ -45,6 +45,7 @@ namespace Org.OpenAPITools.Model
/// <param name="integer">integer</param>
/// <param name="number">number</param>
/// <param name="password">password</param>
/// <param name="patternWithBackslash">None</param>
/// <param name="patternWithDigits">A string that is a 10 digit number. Can have leading zeros.</param>
/// <param name="patternWithDigitsAndDelimiter">A string starting with &#39;image_&#39; (case insensitive) and one to three digits following i.e. Image_01.</param>
/// <param name="stringProperty">stringProperty</param>
@@ -52,7 +53,7 @@ namespace Org.OpenAPITools.Model
/// <param name="unsignedLong">unsignedLong</param>
/// <param name="uuid">uuid</param>
[JsonConstructor]
public FormatTest(System.IO.Stream binary, byte[] byteProperty, DateTime date, DateTime dateTime, decimal decimalProperty, double doubleProperty, float floatProperty, int int32, long int64, int integer, decimal number, string password, string patternWithDigits, string patternWithDigitsAndDelimiter, string stringProperty, uint unsignedInteger, ulong unsignedLong, Guid uuid)
public FormatTest(System.IO.Stream binary, byte[] byteProperty, DateTime date, DateTime dateTime, decimal decimalProperty, double doubleProperty, float floatProperty, int int32, long int64, int integer, decimal number, string password, string patternWithBackslash, string patternWithDigits, string patternWithDigitsAndDelimiter, string stringProperty, uint unsignedInteger, ulong unsignedLong, Guid uuid)
{
Binary = binary;
ByteProperty = byteProperty;
@@ -66,6 +67,7 @@ namespace Org.OpenAPITools.Model
Integer = integer;
Number = number;
Password = password;
PatternWithBackslash = patternWithBackslash;
PatternWithDigits = patternWithDigits;
PatternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter;
StringProperty = stringProperty;
@@ -148,6 +150,13 @@ namespace Org.OpenAPITools.Model
[JsonPropertyName("password")]
public string Password { get; set; }
/// <summary>
/// None
/// </summary>
/// <value>None</value>
[JsonPropertyName("pattern_with_backslash")]
public string PatternWithBackslash { get; set; }
/// <summary>
/// A string that is a 10 digit number. Can have leading zeros.
/// </summary>
@@ -213,6 +222,7 @@ namespace Org.OpenAPITools.Model
sb.Append(" Integer: ").Append(Integer).Append("\n");
sb.Append(" Number: ").Append(Number).Append("\n");
sb.Append(" Password: ").Append(Password).Append("\n");
sb.Append(" PatternWithBackslash: ").Append(PatternWithBackslash).Append("\n");
sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n");
sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n");
sb.Append(" StringProperty: ").Append(StringProperty).Append("\n");
@@ -303,22 +313,29 @@ namespace Org.OpenAPITools.Model
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" });
}
// PatternWithBackslash (string) pattern
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 (false == regexPatternWithBackslash.Match(this.PatternWithBackslash).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" });
}
// PatternWithDigits (string) pattern
Regex regexPatternWithDigits = new Regex("^\\d{10}$", RegexOptions.CultureInvariant);
Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant);
if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
}
// PatternWithDigitsAndDelimiter (string) pattern
Regex regexPatternWithDigitsAndDelimiter = new Regex("^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
}
// StringProperty (string) pattern
Regex regexStringProperty = new Regex("[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
Regex regexStringProperty = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
if (false == regexStringProperty.Match(this.StringProperty).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StringProperty, must match a pattern of " + regexStringProperty, new [] { "StringProperty" });
@@ -384,6 +401,7 @@ namespace Org.OpenAPITools.Model
int integer = default;
decimal number = default;
string password = default;
string patternWithBackslash = default;
string patternWithDigits = default;
string patternWithDigitsAndDelimiter = default;
string stringProperty = default;
@@ -453,6 +471,9 @@ namespace Org.OpenAPITools.Model
case "password":
password = utf8JsonReader.GetString();
break;
case "pattern_with_backslash":
patternWithBackslash = utf8JsonReader.GetString();
break;
case "pattern_with_digits":
patternWithDigits = utf8JsonReader.GetString();
break;
@@ -537,10 +558,13 @@ namespace Org.OpenAPITools.Model
if (patternWithDigitsAndDelimiter == null)
throw new ArgumentNullException(nameof(patternWithDigitsAndDelimiter), "Property is required for class FormatTest.");
if (patternWithBackslash == null)
throw new ArgumentNullException(nameof(patternWithBackslash), "Property is required for class FormatTest.");
#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'
#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null'
return new FormatTest(binary, byteProperty, date, dateTime, decimalProperty, doubleProperty, floatProperty, int32, int64, integer, number, password, patternWithDigits, patternWithDigitsAndDelimiter, stringProperty, unsignedInteger, unsignedLong, uuid);
return new FormatTest(binary, byteProperty, date, dateTime, decimalProperty, doubleProperty, floatProperty, int32, int64, integer, number, password, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, stringProperty, unsignedInteger, unsignedLong, uuid);
}
/// <summary>
@@ -569,6 +593,7 @@ namespace Org.OpenAPITools.Model
writer.WriteNumber("integer", formatTest.Integer);
writer.WriteNumber("number", formatTest.Number);
writer.WriteString("password", formatTest.Password);
writer.WriteString("pattern_with_backslash", formatTest.PatternWithBackslash);
writer.WriteString("pattern_with_digits", formatTest.PatternWithDigits);
writer.WriteString("pattern_with_digits_and_delimiter", formatTest.PatternWithDigitsAndDelimiter);
writer.WriteString("string", formatTest.StringProperty);

View File

@@ -101,7 +101,7 @@ namespace Org.OpenAPITools.Model
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
// UuidWithPattern (Guid) pattern
Regex regexUuidWithPattern = new Regex("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });

View File

@@ -1497,6 +1497,11 @@ components:
to three digits following i.e. Image_01.
pattern: "/^image_\\d{1,3}$/i"
type: string
pattern_with_backslash:
description: None
pattern: "^(([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]))$"
type: string
required:
- byte
- date

View File

@@ -16,6 +16,7 @@ Name | Type | Description | Notes
**Integer** | **int** | | [optional]
**Number** | **decimal** | |
**Password** | **string** | |
**PatternWithBackslash** | **string** | None | [optional]
**PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional]
**PatternWithDigitsAndDelimiter** | **string** | A string starting with &#39;image_&#39; (case insensitive) and one to three digits following i.e. Image_01. | [optional]
**StringProperty** | **string** | | [optional]

View File

@@ -98,7 +98,7 @@ namespace Org.OpenAPITools.Client
/// <returns>Filename</returns>
public static string SanitizeFilename(string filename)
{
Match match = Regex.Match(filename, ".*[/\\](.*)$");
Match match = Regex.Match(filename, @".*[/\\](.*)$");
return match.Success ? match.Groups[1].Value : filename;
}

View File

@@ -81,14 +81,14 @@ namespace Org.OpenAPITools.Model
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
// Cultivar (string) pattern
Regex regexCultivar = new Regex("^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant);
Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant);
if (false == regexCultivar.Match(this.Cultivar).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
}
// Origin (string) pattern
Regex regexOrigin = new Regex("^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
if (false == regexOrigin.Match(this.Origin).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });

View File

@@ -43,6 +43,7 @@ namespace Org.OpenAPITools.Model
/// <param name="integer">integer</param>
/// <param name="number">number</param>
/// <param name="password">password</param>
/// <param name="patternWithBackslash">None</param>
/// <param name="patternWithDigits">A string that is a 10 digit number. Can have leading zeros.</param>
/// <param name="patternWithDigitsAndDelimiter">A string starting with &#39;image_&#39; (case insensitive) and one to three digits following i.e. Image_01.</param>
/// <param name="stringProperty">stringProperty</param>
@@ -50,7 +51,7 @@ namespace Org.OpenAPITools.Model
/// <param name="unsignedLong">unsignedLong</param>
/// <param name="uuid">uuid</param>
[JsonConstructor]
public FormatTest(System.IO.Stream binary, byte[] byteProperty, DateTime date, DateTime dateTime, decimal decimalProperty, double doubleProperty, float floatProperty, int int32, long int64, int integer, decimal number, string password, string patternWithDigits, string patternWithDigitsAndDelimiter, string stringProperty, uint unsignedInteger, ulong unsignedLong, Guid uuid)
public FormatTest(System.IO.Stream binary, byte[] byteProperty, DateTime date, DateTime dateTime, decimal decimalProperty, double doubleProperty, float floatProperty, int int32, long int64, int integer, decimal number, string password, string patternWithBackslash, string patternWithDigits, string patternWithDigitsAndDelimiter, string stringProperty, uint unsignedInteger, ulong unsignedLong, Guid uuid)
{
Binary = binary;
ByteProperty = byteProperty;
@@ -64,6 +65,7 @@ namespace Org.OpenAPITools.Model
Integer = integer;
Number = number;
Password = password;
PatternWithBackslash = patternWithBackslash;
PatternWithDigits = patternWithDigits;
PatternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter;
StringProperty = stringProperty;
@@ -146,6 +148,13 @@ namespace Org.OpenAPITools.Model
[JsonPropertyName("password")]
public string Password { get; set; }
/// <summary>
/// None
/// </summary>
/// <value>None</value>
[JsonPropertyName("pattern_with_backslash")]
public string PatternWithBackslash { get; set; }
/// <summary>
/// A string that is a 10 digit number. Can have leading zeros.
/// </summary>
@@ -211,6 +220,7 @@ namespace Org.OpenAPITools.Model
sb.Append(" Integer: ").Append(Integer).Append("\n");
sb.Append(" Number: ").Append(Number).Append("\n");
sb.Append(" Password: ").Append(Password).Append("\n");
sb.Append(" PatternWithBackslash: ").Append(PatternWithBackslash).Append("\n");
sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n");
sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n");
sb.Append(" StringProperty: ").Append(StringProperty).Append("\n");
@@ -301,22 +311,29 @@ namespace Org.OpenAPITools.Model
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" });
}
// PatternWithBackslash (string) pattern
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 (false == regexPatternWithBackslash.Match(this.PatternWithBackslash).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" });
}
// PatternWithDigits (string) pattern
Regex regexPatternWithDigits = new Regex("^\\d{10}$", RegexOptions.CultureInvariant);
Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant);
if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
}
// PatternWithDigitsAndDelimiter (string) pattern
Regex regexPatternWithDigitsAndDelimiter = new Regex("^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
}
// StringProperty (string) pattern
Regex regexStringProperty = new Regex("[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
Regex regexStringProperty = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
if (false == regexStringProperty.Match(this.StringProperty).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StringProperty, must match a pattern of " + regexStringProperty, new [] { "StringProperty" });
@@ -382,6 +399,7 @@ namespace Org.OpenAPITools.Model
int integer = default;
decimal number = default;
string password = default;
string patternWithBackslash = default;
string patternWithDigits = default;
string patternWithDigitsAndDelimiter = default;
string stringProperty = default;
@@ -451,6 +469,9 @@ namespace Org.OpenAPITools.Model
case "password":
password = utf8JsonReader.GetString();
break;
case "pattern_with_backslash":
patternWithBackslash = utf8JsonReader.GetString();
break;
case "pattern_with_digits":
patternWithDigits = utf8JsonReader.GetString();
break;
@@ -535,10 +556,13 @@ namespace Org.OpenAPITools.Model
if (patternWithDigitsAndDelimiter == null)
throw new ArgumentNullException(nameof(patternWithDigitsAndDelimiter), "Property is required for class FormatTest.");
if (patternWithBackslash == null)
throw new ArgumentNullException(nameof(patternWithBackslash), "Property is required for class FormatTest.");
#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'
#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null'
return new FormatTest(binary, byteProperty, date, dateTime, decimalProperty, doubleProperty, floatProperty, int32, int64, integer, number, password, patternWithDigits, patternWithDigitsAndDelimiter, stringProperty, unsignedInteger, unsignedLong, uuid);
return new FormatTest(binary, byteProperty, date, dateTime, decimalProperty, doubleProperty, floatProperty, int32, int64, integer, number, password, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, stringProperty, unsignedInteger, unsignedLong, uuid);
}
/// <summary>
@@ -567,6 +591,7 @@ namespace Org.OpenAPITools.Model
writer.WriteNumber("integer", formatTest.Integer);
writer.WriteNumber("number", formatTest.Number);
writer.WriteString("password", formatTest.Password);
writer.WriteString("pattern_with_backslash", formatTest.PatternWithBackslash);
writer.WriteString("pattern_with_digits", formatTest.PatternWithDigits);
writer.WriteString("pattern_with_digits_and_delimiter", formatTest.PatternWithDigitsAndDelimiter);
writer.WriteString("string", formatTest.StringProperty);

View File

@@ -99,7 +99,7 @@ namespace Org.OpenAPITools.Model
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
// UuidWithPattern (Guid) pattern
Regex regexUuidWithPattern = new Regex("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });

View File

@@ -100,7 +100,7 @@ namespace Org.OpenAPITools.Client
/// <returns>Filename</returns>
public static string SanitizeFilename(string filename)
{
Match match = Regex.Match(filename, ".*[/\\](.*)$");
Match match = Regex.Match(filename, @".*[/\\](.*)$");
return match.Success ? match.Groups[1].Value : filename;
}

View File

@@ -100,7 +100,7 @@ namespace Org.OpenAPITools.Client
/// <returns>Filename</returns>
public static string SanitizeFilename(string filename)
{
Match match = Regex.Match(filename, ".*[/\\](.*)$");
Match match = Regex.Match(filename, @".*[/\\](.*)$");
return match.Success ? match.Groups[1].Value : filename;
}

View File

@@ -100,7 +100,7 @@ namespace Org.OpenAPITools.Client
/// <returns>Filename</returns>
public static string SanitizeFilename(string filename)
{
Match match = Regex.Match(filename, ".*[/\\](.*)$");
Match match = Regex.Match(filename, @".*[/\\](.*)$");
return match.Success ? match.Groups[1].Value : filename;
}

View File

@@ -1497,6 +1497,11 @@ components:
to three digits following i.e. Image_01.
pattern: "/^image_\\d{1,3}$/i"
type: string
pattern_with_backslash:
description: None
pattern: "^(([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]))$"
type: string
required:
- byte
- date

View File

@@ -16,6 +16,7 @@ Name | Type | Description | Notes
**Integer** | **int** | | [optional]
**Number** | **decimal** | |
**Password** | **string** | |
**PatternWithBackslash** | **string** | None | [optional]
**PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional]
**PatternWithDigitsAndDelimiter** | **string** | A string starting with &#39;image_&#39; (case insensitive) and one to three digits following i.e. Image_01. | [optional]
**StringProperty** | **string** | | [optional]

View File

@@ -98,7 +98,7 @@ namespace Org.OpenAPITools.Client
/// <returns>Filename</returns>
public static string SanitizeFilename(string filename)
{
Match match = Regex.Match(filename, ".*[/\\](.*)$");
Match match = Regex.Match(filename, @".*[/\\](.*)$");
return match.Success ? match.Groups[1].Value : filename;
}

View File

@@ -81,14 +81,14 @@ namespace Org.OpenAPITools.Model
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
// Cultivar (string) pattern
Regex regexCultivar = new Regex("^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant);
Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant);
if (false == regexCultivar.Match(this.Cultivar).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
}
// Origin (string) pattern
Regex regexOrigin = new Regex("^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
if (false == regexOrigin.Match(this.Origin).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });

View File

@@ -43,6 +43,7 @@ namespace Org.OpenAPITools.Model
/// <param name="integer">integer</param>
/// <param name="number">number</param>
/// <param name="password">password</param>
/// <param name="patternWithBackslash">None</param>
/// <param name="patternWithDigits">A string that is a 10 digit number. Can have leading zeros.</param>
/// <param name="patternWithDigitsAndDelimiter">A string starting with &#39;image_&#39; (case insensitive) and one to three digits following i.e. Image_01.</param>
/// <param name="stringProperty">stringProperty</param>
@@ -50,7 +51,7 @@ namespace Org.OpenAPITools.Model
/// <param name="unsignedLong">unsignedLong</param>
/// <param name="uuid">uuid</param>
[JsonConstructor]
public FormatTest(System.IO.Stream binary, byte[] byteProperty, DateTime date, DateTime dateTime, decimal decimalProperty, double doubleProperty, float floatProperty, int int32, long int64, int integer, decimal number, string password, string patternWithDigits, string patternWithDigitsAndDelimiter, string stringProperty, uint unsignedInteger, ulong unsignedLong, Guid uuid)
public FormatTest(System.IO.Stream binary, byte[] byteProperty, DateTime date, DateTime dateTime, decimal decimalProperty, double doubleProperty, float floatProperty, int int32, long int64, int integer, decimal number, string password, string patternWithBackslash, string patternWithDigits, string patternWithDigitsAndDelimiter, string stringProperty, uint unsignedInteger, ulong unsignedLong, Guid uuid)
{
Binary = binary;
ByteProperty = byteProperty;
@@ -64,6 +65,7 @@ namespace Org.OpenAPITools.Model
Integer = integer;
Number = number;
Password = password;
PatternWithBackslash = patternWithBackslash;
PatternWithDigits = patternWithDigits;
PatternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter;
StringProperty = stringProperty;
@@ -146,6 +148,13 @@ namespace Org.OpenAPITools.Model
[JsonPropertyName("password")]
public string Password { get; set; }
/// <summary>
/// None
/// </summary>
/// <value>None</value>
[JsonPropertyName("pattern_with_backslash")]
public string PatternWithBackslash { get; set; }
/// <summary>
/// A string that is a 10 digit number. Can have leading zeros.
/// </summary>
@@ -211,6 +220,7 @@ namespace Org.OpenAPITools.Model
sb.Append(" Integer: ").Append(Integer).Append("\n");
sb.Append(" Number: ").Append(Number).Append("\n");
sb.Append(" Password: ").Append(Password).Append("\n");
sb.Append(" PatternWithBackslash: ").Append(PatternWithBackslash).Append("\n");
sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n");
sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n");
sb.Append(" StringProperty: ").Append(StringProperty).Append("\n");
@@ -301,22 +311,29 @@ namespace Org.OpenAPITools.Model
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" });
}
// PatternWithBackslash (string) pattern
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 (false == regexPatternWithBackslash.Match(this.PatternWithBackslash).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" });
}
// PatternWithDigits (string) pattern
Regex regexPatternWithDigits = new Regex("^\\d{10}$", RegexOptions.CultureInvariant);
Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant);
if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
}
// PatternWithDigitsAndDelimiter (string) pattern
Regex regexPatternWithDigitsAndDelimiter = new Regex("^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
}
// StringProperty (string) pattern
Regex regexStringProperty = new Regex("[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
Regex regexStringProperty = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
if (false == regexStringProperty.Match(this.StringProperty).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StringProperty, must match a pattern of " + regexStringProperty, new [] { "StringProperty" });
@@ -382,6 +399,7 @@ namespace Org.OpenAPITools.Model
int integer = default;
decimal number = default;
string password = default;
string patternWithBackslash = default;
string patternWithDigits = default;
string patternWithDigitsAndDelimiter = default;
string stringProperty = default;
@@ -451,6 +469,9 @@ namespace Org.OpenAPITools.Model
case "password":
password = utf8JsonReader.GetString();
break;
case "pattern_with_backslash":
patternWithBackslash = utf8JsonReader.GetString();
break;
case "pattern_with_digits":
patternWithDigits = utf8JsonReader.GetString();
break;
@@ -535,10 +556,13 @@ namespace Org.OpenAPITools.Model
if (patternWithDigitsAndDelimiter == null)
throw new ArgumentNullException(nameof(patternWithDigitsAndDelimiter), "Property is required for class FormatTest.");
if (patternWithBackslash == null)
throw new ArgumentNullException(nameof(patternWithBackslash), "Property is required for class FormatTest.");
#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'
#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null'
return new FormatTest(binary, byteProperty, date, dateTime, decimalProperty, doubleProperty, floatProperty, int32, int64, integer, number, password, patternWithDigits, patternWithDigitsAndDelimiter, stringProperty, unsignedInteger, unsignedLong, uuid);
return new FormatTest(binary, byteProperty, date, dateTime, decimalProperty, doubleProperty, floatProperty, int32, int64, integer, number, password, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, stringProperty, unsignedInteger, unsignedLong, uuid);
}
/// <summary>
@@ -567,6 +591,7 @@ namespace Org.OpenAPITools.Model
writer.WriteNumber("integer", formatTest.Integer);
writer.WriteNumber("number", formatTest.Number);
writer.WriteString("password", formatTest.Password);
writer.WriteString("pattern_with_backslash", formatTest.PatternWithBackslash);
writer.WriteString("pattern_with_digits", formatTest.PatternWithDigits);
writer.WriteString("pattern_with_digits_and_delimiter", formatTest.PatternWithDigitsAndDelimiter);
writer.WriteString("string", formatTest.StringProperty);

View File

@@ -99,7 +99,7 @@ namespace Org.OpenAPITools.Model
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
// UuidWithPattern (Guid) pattern
Regex regexUuidWithPattern = new Regex("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });

View File

@@ -1497,6 +1497,11 @@ components:
to three digits following i.e. Image_01.
pattern: "/^image_\\d{1,3}$/i"
type: string
pattern_with_backslash:
description: None
pattern: "^(([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]))$"
type: string
required:
- byte
- date

View File

@@ -22,6 +22,7 @@ Name | Type | Description | Notes
**Password** | **string** | |
**PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional]
**PatternWithDigitsAndDelimiter** | **string** | A string starting with &#39;image_&#39; (case insensitive) and one to three digits following i.e. Image_01. | [optional]
**PatternWithBackslash** | **string** | None | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Client
/// <returns>Filename</returns>
public static string SanitizeFilename(string filename)
{
Match match = Regex.Match(filename, ".*[/\\](.*)$");
Match match = Regex.Match(filename, @".*[/\\](.*)$");
return match.Success ? match.Groups[1].Value : filename;
}

View File

@@ -140,14 +140,14 @@ namespace Org.OpenAPITools.Model
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
// Cultivar (string) pattern
Regex regexCultivar = new Regex("^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant);
Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant);
if (false == regexCultivar.Match(this.Cultivar).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
}
// Origin (string) pattern
Regex regexOrigin = new Regex("^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
if (false == regexOrigin.Match(this.Origin).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });

View File

@@ -62,7 +62,8 @@ namespace Org.OpenAPITools.Model
/// <param name="password">password (required).</param>
/// <param name="patternWithDigits">A string that is a 10 digit number. Can have leading zeros..</param>
/// <param name="patternWithDigitsAndDelimiter">A string starting with &#39;image_&#39; (case insensitive) and one to three digits following i.e. Image_01..</param>
public FormatTest(int integer = default(int), int int32 = default(int), uint unsignedInteger = default(uint), long int64 = default(long), ulong unsignedLong = default(ulong), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), FileParameter binary = default(FileParameter), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string))
/// <param name="patternWithBackslash">None.</param>
public FormatTest(int integer = default(int), int int32 = default(int), uint unsignedInteger = default(uint), long int64 = default(long), ulong unsignedLong = default(ulong), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), FileParameter binary = default(FileParameter), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string), string patternWithBackslash = default(string))
{
this.Number = number;
// to ensure "_byte" is required (not null)
@@ -92,6 +93,7 @@ namespace Org.OpenAPITools.Model
this.Uuid = uuid;
this.PatternWithDigits = patternWithDigits;
this.PatternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter;
this.PatternWithBackslash = patternWithBackslash;
this.AdditionalProperties = new Dictionary<string, object>();
}
@@ -209,6 +211,13 @@ namespace Org.OpenAPITools.Model
[DataMember(Name = "pattern_with_digits_and_delimiter", EmitDefaultValue = false)]
public string PatternWithDigitsAndDelimiter { get; set; }
/// <summary>
/// None
/// </summary>
/// <value>None</value>
[DataMember(Name = "pattern_with_backslash", EmitDefaultValue = false)]
public string PatternWithBackslash { get; set; }
/// <summary>
/// Gets or Sets additional properties
/// </summary>
@@ -241,6 +250,7 @@ namespace Org.OpenAPITools.Model
sb.Append(" Password: ").Append(Password).Append("\n");
sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n");
sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n");
sb.Append(" PatternWithBackslash: ").Append(PatternWithBackslash).Append("\n");
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
sb.Append("}\n");
return sb.ToString();
@@ -329,6 +339,10 @@ namespace Org.OpenAPITools.Model
{
hashCode = (hashCode * 59) + this.PatternWithDigitsAndDelimiter.GetHashCode();
}
if (this.PatternWithBackslash != null)
{
hashCode = (hashCode * 59) + this.PatternWithBackslash.GetHashCode();
}
if (this.AdditionalProperties != null)
{
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
@@ -417,7 +431,7 @@ namespace Org.OpenAPITools.Model
}
// String (string) pattern
Regex regexString = new Regex("[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
Regex regexString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
if (false == regexString.Match(this.String).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" });
@@ -436,19 +450,26 @@ namespace Org.OpenAPITools.Model
}
// PatternWithDigits (string) pattern
Regex regexPatternWithDigits = new Regex("^\\d{10}$", RegexOptions.CultureInvariant);
Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant);
if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
}
// PatternWithDigitsAndDelimiter (string) pattern
Regex regexPatternWithDigitsAndDelimiter = new Regex("^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
}
// PatternWithBackslash (string) pattern
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 (false == 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 break;
}
}

View File

@@ -166,7 +166,7 @@ namespace Org.OpenAPITools.Model
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
// UuidWithPattern (Guid) pattern
Regex regexUuidWithPattern = new Regex("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });

View File

@@ -1497,6 +1497,11 @@ components:
to three digits following i.e. Image_01.
pattern: "/^image_\\d{1,3}$/i"
type: string
pattern_with_backslash:
description: None
pattern: "^(([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]))$"
type: string
required:
- byte
- date

View File

@@ -22,6 +22,7 @@ Name | Type | Description | Notes
**Password** | **string** | |
**PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional]
**PatternWithDigitsAndDelimiter** | **string** | A string starting with &#39;image_&#39; (case insensitive) and one to three digits following i.e. Image_01. | [optional]
**PatternWithBackslash** | **string** | None | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Client
/// <returns>Filename</returns>
public static string SanitizeFilename(string filename)
{
Match match = Regex.Match(filename, ".*[/\\](.*)$");
Match match = Regex.Match(filename, @".*[/\\](.*)$");
return match.Success ? match.Groups[1].Value : filename;
}

View File

@@ -139,14 +139,14 @@ namespace Org.OpenAPITools.Model
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
// Cultivar (string) pattern
Regex regexCultivar = new Regex("^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant);
Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant);
if (false == regexCultivar.Match(this.Cultivar).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
}
// Origin (string) pattern
Regex regexOrigin = new Regex("^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
if (false == regexOrigin.Match(this.Origin).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });

View File

@@ -61,7 +61,8 @@ namespace Org.OpenAPITools.Model
/// <param name="password">password (required).</param>
/// <param name="patternWithDigits">A string that is a 10 digit number. Can have leading zeros..</param>
/// <param name="patternWithDigitsAndDelimiter">A string starting with &#39;image_&#39; (case insensitive) and one to three digits following i.e. Image_01..</param>
public FormatTest(int integer = default(int), int int32 = default(int), uint unsignedInteger = default(uint), long int64 = default(long), ulong unsignedLong = default(ulong), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string))
/// <param name="patternWithBackslash">None.</param>
public FormatTest(int integer = default(int), int int32 = default(int), uint unsignedInteger = default(uint), long int64 = default(long), ulong unsignedLong = default(ulong), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string), string patternWithBackslash = default(string))
{
this.Number = number;
// to ensure "_byte" is required (not null)
@@ -91,6 +92,7 @@ namespace Org.OpenAPITools.Model
this.Uuid = uuid;
this.PatternWithDigits = patternWithDigits;
this.PatternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter;
this.PatternWithBackslash = patternWithBackslash;
this.AdditionalProperties = new Dictionary<string, object>();
}
@@ -208,6 +210,13 @@ namespace Org.OpenAPITools.Model
[DataMember(Name = "pattern_with_digits_and_delimiter", EmitDefaultValue = false)]
public string PatternWithDigitsAndDelimiter { get; set; }
/// <summary>
/// None
/// </summary>
/// <value>None</value>
[DataMember(Name = "pattern_with_backslash", EmitDefaultValue = false)]
public string PatternWithBackslash { get; set; }
/// <summary>
/// Gets or Sets additional properties
/// </summary>
@@ -240,6 +249,7 @@ namespace Org.OpenAPITools.Model
sb.Append(" Password: ").Append(Password).Append("\n");
sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n");
sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n");
sb.Append(" PatternWithBackslash: ").Append(PatternWithBackslash).Append("\n");
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
sb.Append("}\n");
return sb.ToString();
@@ -328,6 +338,10 @@ namespace Org.OpenAPITools.Model
{
hashCode = (hashCode * 59) + this.PatternWithDigitsAndDelimiter.GetHashCode();
}
if (this.PatternWithBackslash != null)
{
hashCode = (hashCode * 59) + this.PatternWithBackslash.GetHashCode();
}
if (this.AdditionalProperties != null)
{
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
@@ -416,7 +430,7 @@ namespace Org.OpenAPITools.Model
}
// String (string) pattern
Regex regexString = new Regex("[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
Regex regexString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
if (false == regexString.Match(this.String).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" });
@@ -435,19 +449,26 @@ namespace Org.OpenAPITools.Model
}
// PatternWithDigits (string) pattern
Regex regexPatternWithDigits = new Regex("^\\d{10}$", RegexOptions.CultureInvariant);
Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant);
if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
}
// PatternWithDigitsAndDelimiter (string) pattern
Regex regexPatternWithDigitsAndDelimiter = new Regex("^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
}
// PatternWithBackslash (string) pattern
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 (false == 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 break;
}
}

View File

@@ -165,7 +165,7 @@ namespace Org.OpenAPITools.Model
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
// UuidWithPattern (Guid) pattern
Regex regexUuidWithPattern = new Regex("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });

View File

@@ -1497,6 +1497,11 @@ components:
to three digits following i.e. Image_01.
pattern: "/^image_\\d{1,3}$/i"
type: string
pattern_with_backslash:
description: None
pattern: "^(([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]))$"
type: string
required:
- byte
- date

View File

@@ -22,6 +22,7 @@ Name | Type | Description | Notes
**Password** | **string** | |
**PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional]
**PatternWithDigitsAndDelimiter** | **string** | A string starting with &#39;image_&#39; (case insensitive) and one to three digits following i.e. Image_01. | [optional]
**PatternWithBackslash** | **string** | None | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Client
/// <returns>Filename</returns>
public static string SanitizeFilename(string filename)
{
Match match = Regex.Match(filename, ".*[/\\](.*)$");
Match match = Regex.Match(filename, @".*[/\\](.*)$");
return match.Success ? match.Groups[1].Value : filename;
}

View File

@@ -139,14 +139,14 @@ namespace Org.OpenAPITools.Model
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
// Cultivar (string) pattern
Regex regexCultivar = new Regex("^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant);
Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant);
if (false == regexCultivar.Match(this.Cultivar).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
}
// Origin (string) pattern
Regex regexOrigin = new Regex("^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
if (false == regexOrigin.Match(this.Origin).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });

View File

@@ -61,7 +61,8 @@ namespace Org.OpenAPITools.Model
/// <param name="password">password (required).</param>
/// <param name="patternWithDigits">A string that is a 10 digit number. Can have leading zeros..</param>
/// <param name="patternWithDigitsAndDelimiter">A string starting with &#39;image_&#39; (case insensitive) and one to three digits following i.e. Image_01..</param>
public FormatTest(int integer = default(int), int int32 = default(int), uint unsignedInteger = default(uint), long int64 = default(long), ulong unsignedLong = default(ulong), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string))
/// <param name="patternWithBackslash">None.</param>
public FormatTest(int integer = default(int), int int32 = default(int), uint unsignedInteger = default(uint), long int64 = default(long), ulong unsignedLong = default(ulong), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string), string patternWithBackslash = default(string))
{
this.Number = number;
// to ensure "_byte" is required (not null)
@@ -91,6 +92,7 @@ namespace Org.OpenAPITools.Model
this.Uuid = uuid;
this.PatternWithDigits = patternWithDigits;
this.PatternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter;
this.PatternWithBackslash = patternWithBackslash;
this.AdditionalProperties = new Dictionary<string, object>();
}
@@ -208,6 +210,13 @@ namespace Org.OpenAPITools.Model
[DataMember(Name = "pattern_with_digits_and_delimiter", EmitDefaultValue = false)]
public string PatternWithDigitsAndDelimiter { get; set; }
/// <summary>
/// None
/// </summary>
/// <value>None</value>
[DataMember(Name = "pattern_with_backslash", EmitDefaultValue = false)]
public string PatternWithBackslash { get; set; }
/// <summary>
/// Gets or Sets additional properties
/// </summary>
@@ -240,6 +249,7 @@ namespace Org.OpenAPITools.Model
sb.Append(" Password: ").Append(Password).Append("\n");
sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n");
sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n");
sb.Append(" PatternWithBackslash: ").Append(PatternWithBackslash).Append("\n");
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
sb.Append("}\n");
return sb.ToString();
@@ -328,6 +338,10 @@ namespace Org.OpenAPITools.Model
{
hashCode = (hashCode * 59) + this.PatternWithDigitsAndDelimiter.GetHashCode();
}
if (this.PatternWithBackslash != null)
{
hashCode = (hashCode * 59) + this.PatternWithBackslash.GetHashCode();
}
if (this.AdditionalProperties != null)
{
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
@@ -416,7 +430,7 @@ namespace Org.OpenAPITools.Model
}
// String (string) pattern
Regex regexString = new Regex("[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
Regex regexString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
if (false == regexString.Match(this.String).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" });
@@ -435,19 +449,26 @@ namespace Org.OpenAPITools.Model
}
// PatternWithDigits (string) pattern
Regex regexPatternWithDigits = new Regex("^\\d{10}$", RegexOptions.CultureInvariant);
Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant);
if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
}
// PatternWithDigitsAndDelimiter (string) pattern
Regex regexPatternWithDigitsAndDelimiter = new Regex("^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
}
// PatternWithBackslash (string) pattern
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 (false == 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 break;
}
}

View File

@@ -165,7 +165,7 @@ namespace Org.OpenAPITools.Model
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
// UuidWithPattern (Guid) pattern
Regex regexUuidWithPattern = new Regex("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });

View File

@@ -1497,6 +1497,11 @@ components:
to three digits following i.e. Image_01.
pattern: "/^image_\\d{1,3}$/i"
type: string
pattern_with_backslash:
description: None
pattern: "^(([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]))$"
type: string
required:
- byte
- date

View File

@@ -22,6 +22,7 @@ Name | Type | Description | Notes
**Password** | **string** | |
**PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional]
**PatternWithDigitsAndDelimiter** | **string** | A string starting with &#39;image_&#39; (case insensitive) and one to three digits following i.e. Image_01. | [optional]
**PatternWithBackslash** | **string** | None | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Client
/// <returns>Filename</returns>
public static string SanitizeFilename(string filename)
{
Match match = Regex.Match(filename, ".*[/\\](.*)$");
Match match = Regex.Match(filename, @".*[/\\](.*)$");
return match.Success ? match.Groups[1].Value : filename;
}

View File

@@ -139,14 +139,14 @@ namespace Org.OpenAPITools.Model
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
// Cultivar (string) pattern
Regex regexCultivar = new Regex("^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant);
Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant);
if (false == regexCultivar.Match(this.Cultivar).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
}
// Origin (string) pattern
Regex regexOrigin = new Regex("^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
if (false == regexOrigin.Match(this.Origin).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });

View File

@@ -61,7 +61,8 @@ namespace Org.OpenAPITools.Model
/// <param name="password">password (required).</param>
/// <param name="patternWithDigits">A string that is a 10 digit number. Can have leading zeros..</param>
/// <param name="patternWithDigitsAndDelimiter">A string starting with &#39;image_&#39; (case insensitive) and one to three digits following i.e. Image_01..</param>
public FormatTest(int integer = default(int), int int32 = default(int), uint unsignedInteger = default(uint), long int64 = default(long), ulong unsignedLong = default(ulong), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string))
/// <param name="patternWithBackslash">None.</param>
public FormatTest(int integer = default(int), int int32 = default(int), uint unsignedInteger = default(uint), long int64 = default(long), ulong unsignedLong = default(ulong), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string), string patternWithBackslash = default(string))
{
this.Number = number;
// to ensure "_byte" is required (not null)
@@ -91,6 +92,7 @@ namespace Org.OpenAPITools.Model
this.Uuid = uuid;
this.PatternWithDigits = patternWithDigits;
this.PatternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter;
this.PatternWithBackslash = patternWithBackslash;
this.AdditionalProperties = new Dictionary<string, object>();
}
@@ -208,6 +210,13 @@ namespace Org.OpenAPITools.Model
[DataMember(Name = "pattern_with_digits_and_delimiter", EmitDefaultValue = false)]
public string PatternWithDigitsAndDelimiter { get; set; }
/// <summary>
/// None
/// </summary>
/// <value>None</value>
[DataMember(Name = "pattern_with_backslash", EmitDefaultValue = false)]
public string PatternWithBackslash { get; set; }
/// <summary>
/// Gets or Sets additional properties
/// </summary>
@@ -240,6 +249,7 @@ namespace Org.OpenAPITools.Model
sb.Append(" Password: ").Append(Password).Append("\n");
sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n");
sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n");
sb.Append(" PatternWithBackslash: ").Append(PatternWithBackslash).Append("\n");
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
sb.Append("}\n");
return sb.ToString();
@@ -328,6 +338,10 @@ namespace Org.OpenAPITools.Model
{
hashCode = (hashCode * 59) + this.PatternWithDigitsAndDelimiter.GetHashCode();
}
if (this.PatternWithBackslash != null)
{
hashCode = (hashCode * 59) + this.PatternWithBackslash.GetHashCode();
}
if (this.AdditionalProperties != null)
{
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
@@ -416,7 +430,7 @@ namespace Org.OpenAPITools.Model
}
// String (string) pattern
Regex regexString = new Regex("[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
Regex regexString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
if (false == regexString.Match(this.String).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" });
@@ -435,19 +449,26 @@ namespace Org.OpenAPITools.Model
}
// PatternWithDigits (string) pattern
Regex regexPatternWithDigits = new Regex("^\\d{10}$", RegexOptions.CultureInvariant);
Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant);
if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
}
// PatternWithDigitsAndDelimiter (string) pattern
Regex regexPatternWithDigitsAndDelimiter = new Regex("^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
}
// PatternWithBackslash (string) pattern
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 (false == 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 break;
}
}

View File

@@ -165,7 +165,7 @@ namespace Org.OpenAPITools.Model
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
// UuidWithPattern (Guid) pattern
Regex regexUuidWithPattern = new Regex("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });

View File

@@ -1497,6 +1497,11 @@ components:
to three digits following i.e. Image_01.
pattern: "/^image_\\d{1,3}$/i"
type: string
pattern_with_backslash:
description: None
pattern: "^(([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]))$"
type: string
required:
- byte
- date

View File

@@ -22,6 +22,7 @@ Name | Type | Description | Notes
**Password** | **string** | |
**PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional]
**PatternWithDigitsAndDelimiter** | **string** | A string starting with &#39;image_&#39; (case insensitive) and one to three digits following i.e. Image_01. | [optional]
**PatternWithBackslash** | **string** | None | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -32,7 +32,7 @@ namespace Org.OpenAPITools.Client
/// <returns>Filename</returns>
public static string SanitizeFilename(string filename)
{
Match match = Regex.Match(filename, ".*[/\\](.*)$");
Match match = Regex.Match(filename, @".*[/\\](.*)$");
return match.Success ? match.Groups[1].Value : filename;
}

View File

@@ -56,7 +56,8 @@ namespace Org.OpenAPITools.Model
/// <param name="password">password (required).</param>
/// <param name="patternWithDigits">A string that is a 10 digit number. Can have leading zeros..</param>
/// <param name="patternWithDigitsAndDelimiter">A string starting with &#39;image_&#39; (case insensitive) and one to three digits following i.e. Image_01..</param>
public FormatTest(int integer = default(int), int int32 = default(int), uint unsignedInteger = default(uint), long int64 = default(long), ulong unsignedLong = default(ulong), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string))
/// <param name="patternWithBackslash">None.</param>
public FormatTest(int integer = default(int), int int32 = default(int), uint unsignedInteger = default(uint), long int64 = default(long), ulong unsignedLong = default(ulong), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string), string patternWithBackslash = default(string))
{
this.Number = number;
// to ensure "_byte" is required (not null)
@@ -86,6 +87,7 @@ namespace Org.OpenAPITools.Model
this.Uuid = uuid;
this.PatternWithDigits = patternWithDigits;
this.PatternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter;
this.PatternWithBackslash = patternWithBackslash;
}
/// <summary>
@@ -202,6 +204,13 @@ namespace Org.OpenAPITools.Model
[DataMember(Name = "pattern_with_digits_and_delimiter", EmitDefaultValue = false)]
public string PatternWithDigitsAndDelimiter { get; set; }
/// <summary>
/// None
/// </summary>
/// <value>None</value>
[DataMember(Name = "pattern_with_backslash", EmitDefaultValue = false)]
public string PatternWithBackslash { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
@@ -228,6 +237,7 @@ namespace Org.OpenAPITools.Model
sb.Append(" Password: ").Append(Password).Append("\n");
sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n");
sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n");
sb.Append(" PatternWithBackslash: ").Append(PatternWithBackslash).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
@@ -343,6 +353,11 @@ namespace Org.OpenAPITools.Model
this.PatternWithDigitsAndDelimiter == input.PatternWithDigitsAndDelimiter ||
(this.PatternWithDigitsAndDelimiter != null &&
this.PatternWithDigitsAndDelimiter.Equals(input.PatternWithDigitsAndDelimiter))
) &&
(
this.PatternWithBackslash == input.PatternWithBackslash ||
(this.PatternWithBackslash != null &&
this.PatternWithBackslash.Equals(input.PatternWithBackslash))
);
}
@@ -400,6 +415,10 @@ namespace Org.OpenAPITools.Model
{
hashCode = (hashCode * 59) + this.PatternWithDigitsAndDelimiter.GetHashCode();
}
if (this.PatternWithBackslash != null)
{
hashCode = (hashCode * 59) + this.PatternWithBackslash.GetHashCode();
}
return hashCode;
}
}

View File

@@ -1497,6 +1497,11 @@ components:
to three digits following i.e. Image_01.
pattern: "/^image_\\d{1,3}$/i"
type: string
pattern_with_backslash:
description: None
pattern: "^(([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]))$"
type: string
required:
- byte
- date

View File

@@ -22,6 +22,7 @@ Name | Type | Description | Notes
**Password** | **string** | |
**PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional]
**PatternWithDigitsAndDelimiter** | **string** | A string starting with &#39;image_&#39; (case insensitive) and one to three digits following i.e. Image_01. | [optional]
**PatternWithBackslash** | **string** | None | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Client
/// <returns>Filename</returns>
public static string SanitizeFilename(string filename)
{
Match match = Regex.Match(filename, ".*[/\\](.*)$");
Match match = Regex.Match(filename, @".*[/\\](.*)$");
return match.Success ? match.Groups[1].Value : filename;
}

View File

@@ -139,14 +139,14 @@ namespace Org.OpenAPITools.Model
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
// Cultivar (string) pattern
Regex regexCultivar = new Regex("^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant);
Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant);
if (false == regexCultivar.Match(this.Cultivar).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
}
// Origin (string) pattern
Regex regexOrigin = new Regex("^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
if (false == regexOrigin.Match(this.Origin).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });

View File

@@ -61,7 +61,8 @@ namespace Org.OpenAPITools.Model
/// <param name="password">password (required).</param>
/// <param name="patternWithDigits">A string that is a 10 digit number. Can have leading zeros..</param>
/// <param name="patternWithDigitsAndDelimiter">A string starting with &#39;image_&#39; (case insensitive) and one to three digits following i.e. Image_01..</param>
public FormatTest(int integer = default(int), int int32 = default(int), uint unsignedInteger = default(uint), long int64 = default(long), ulong unsignedLong = default(ulong), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string))
/// <param name="patternWithBackslash">None.</param>
public FormatTest(int integer = default(int), int int32 = default(int), uint unsignedInteger = default(uint), long int64 = default(long), ulong unsignedLong = default(ulong), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string), string patternWithBackslash = default(string))
{
this.Number = number;
// to ensure "_byte" is required (not null)
@@ -91,6 +92,7 @@ namespace Org.OpenAPITools.Model
this.Uuid = uuid;
this.PatternWithDigits = patternWithDigits;
this.PatternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter;
this.PatternWithBackslash = patternWithBackslash;
this.AdditionalProperties = new Dictionary<string, object>();
}
@@ -208,6 +210,13 @@ namespace Org.OpenAPITools.Model
[DataMember(Name = "pattern_with_digits_and_delimiter", EmitDefaultValue = false)]
public string PatternWithDigitsAndDelimiter { get; set; }
/// <summary>
/// None
/// </summary>
/// <value>None</value>
[DataMember(Name = "pattern_with_backslash", EmitDefaultValue = false)]
public string PatternWithBackslash { get; set; }
/// <summary>
/// Gets or Sets additional properties
/// </summary>
@@ -240,6 +249,7 @@ namespace Org.OpenAPITools.Model
sb.Append(" Password: ").Append(Password).Append("\n");
sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n");
sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n");
sb.Append(" PatternWithBackslash: ").Append(PatternWithBackslash).Append("\n");
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
sb.Append("}\n");
return sb.ToString();
@@ -328,6 +338,10 @@ namespace Org.OpenAPITools.Model
{
hashCode = (hashCode * 59) + this.PatternWithDigitsAndDelimiter.GetHashCode();
}
if (this.PatternWithBackslash != null)
{
hashCode = (hashCode * 59) + this.PatternWithBackslash.GetHashCode();
}
if (this.AdditionalProperties != null)
{
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
@@ -416,7 +430,7 @@ namespace Org.OpenAPITools.Model
}
// String (string) pattern
Regex regexString = new Regex("[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
Regex regexString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
if (false == regexString.Match(this.String).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" });
@@ -435,19 +449,26 @@ namespace Org.OpenAPITools.Model
}
// PatternWithDigits (string) pattern
Regex regexPatternWithDigits = new Regex("^\\d{10}$", RegexOptions.CultureInvariant);
Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant);
if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
}
// PatternWithDigitsAndDelimiter (string) pattern
Regex regexPatternWithDigitsAndDelimiter = new Regex("^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
}
// PatternWithBackslash (string) pattern
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 (false == 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 break;
}
}

View File

@@ -165,7 +165,7 @@ namespace Org.OpenAPITools.Model
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
// UuidWithPattern (Guid) pattern
Regex regexUuidWithPattern = new Regex("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });

View File

@@ -1497,6 +1497,11 @@ components:
to three digits following i.e. Image_01.
pattern: "/^image_\\d{1,3}$/i"
type: string
pattern_with_backslash:
description: None
pattern: "^(([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]))$"
type: string
required:
- byte
- date

View File

@@ -22,6 +22,7 @@ Name | Type | Description | Notes
**Password** | **string** | |
**PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional]
**PatternWithDigitsAndDelimiter** | **string** | A string starting with &#39;image_&#39; (case insensitive) and one to three digits following i.e. Image_01. | [optional]
**PatternWithBackslash** | **string** | None | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Client
/// <returns>Filename</returns>
public static string SanitizeFilename(string filename)
{
Match match = Regex.Match(filename, ".*[/\\](.*)$");
Match match = Regex.Match(filename, @".*[/\\](.*)$");
return match.Success ? match.Groups[1].Value : filename;
}

View File

@@ -127,14 +127,14 @@ namespace Org.OpenAPITools.Model
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
// Cultivar (string) pattern
Regex regexCultivar = new Regex("^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant);
Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant);
if (false == regexCultivar.Match(this.Cultivar).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
}
// Origin (string) pattern
Regex regexOrigin = new Regex("^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
if (false == regexOrigin.Match(this.Origin).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });

View File

@@ -58,7 +58,8 @@ namespace Org.OpenAPITools.Model
/// <param name="password">password (required).</param>
/// <param name="patternWithDigits">A string that is a 10 digit number. Can have leading zeros..</param>
/// <param name="patternWithDigitsAndDelimiter">A string starting with &#39;image_&#39; (case insensitive) and one to three digits following i.e. Image_01..</param>
public FormatTest(int integer = default(int), int int32 = default(int), uint unsignedInteger = default(uint), long int64 = default(long), ulong unsignedLong = default(ulong), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string))
/// <param name="patternWithBackslash">None.</param>
public FormatTest(int integer = default(int), int int32 = default(int), uint unsignedInteger = default(uint), long int64 = default(long), ulong unsignedLong = default(ulong), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string), string patternWithBackslash = default(string))
{
this.Number = number;
// to ensure "_byte" is required (not null)
@@ -88,6 +89,7 @@ namespace Org.OpenAPITools.Model
this.Uuid = uuid;
this.PatternWithDigits = patternWithDigits;
this.PatternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter;
this.PatternWithBackslash = patternWithBackslash;
}
/// <summary>
@@ -204,6 +206,13 @@ namespace Org.OpenAPITools.Model
[DataMember(Name = "pattern_with_digits_and_delimiter", EmitDefaultValue = false)]
public string PatternWithDigitsAndDelimiter { get; set; }
/// <summary>
/// None
/// </summary>
/// <value>None</value>
[DataMember(Name = "pattern_with_backslash", EmitDefaultValue = false)]
public string PatternWithBackslash { get; set; }
/// <summary>
/// Returns the string presentation of the object
/// </summary>
@@ -230,6 +239,7 @@ namespace Org.OpenAPITools.Model
sb.Append(" Password: ").Append(Password).Append("\n");
sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n");
sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n");
sb.Append(" PatternWithBackslash: ").Append(PatternWithBackslash).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
@@ -317,6 +327,10 @@ namespace Org.OpenAPITools.Model
{
hashCode = (hashCode * 59) + this.PatternWithDigitsAndDelimiter.GetHashCode();
}
if (this.PatternWithBackslash != null)
{
hashCode = (hashCode * 59) + this.PatternWithBackslash.GetHashCode();
}
return hashCode;
}
}
@@ -401,7 +415,7 @@ namespace Org.OpenAPITools.Model
}
// String (string) pattern
Regex regexString = new Regex("[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
Regex regexString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
if (false == regexString.Match(this.String).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" });
@@ -420,19 +434,26 @@ namespace Org.OpenAPITools.Model
}
// PatternWithDigits (string) pattern
Regex regexPatternWithDigits = new Regex("^\\d{10}$", RegexOptions.CultureInvariant);
Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant);
if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
}
// PatternWithDigitsAndDelimiter (string) pattern
Regex regexPatternWithDigitsAndDelimiter = new Regex("^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
}
// PatternWithBackslash (string) pattern
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 (false == 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 break;
}
}

View File

@@ -153,7 +153,7 @@ namespace Org.OpenAPITools.Model
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
// UuidWithPattern (Guid) pattern
Regex regexUuidWithPattern = new Regex("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });

View File

@@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Client
/// <returns>Filename</returns>
public static string SanitizeFilename(string filename)
{
Match match = Regex.Match(filename, ".*[/\\](.*)$");
Match match = Regex.Match(filename, @".*[/\\](.*)$");
return match.Success ? match.Groups[1].Value : filename;
}

View File

@@ -124,7 +124,7 @@ namespace Org.OpenAPITools.Model
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
{
// Name (string) pattern
Regex regexName = new Regex("^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$", RegexOptions.CultureInvariant);
Regex regexName = new Regex(@"^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$", RegexOptions.CultureInvariant);
if (false == regexName.Match(this.Name).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Name, must match a pattern of " + regexName, new [] { "Name" });

View File

@@ -495,7 +495,7 @@ namespace Org.OpenAPITools.Model
// PatternWithDigits (string) pattern
Regex regexPatternWithDigits = new Regex(@"^\\d{10}$", RegexOptions.CultureInvariant);
Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant);
if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
@@ -504,7 +504,7 @@ namespace Org.OpenAPITools.Model
// PatternWithDigitsAndDelimiter (string) pattern
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
{
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });