Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}

{{/isNullable}}
{{/required}}
if not isinstance(value, str):
value = str(value)

if not re.match(r"{{{.}}}", value{{#vendorExtensions.x-modifiers}} ,re.{{{.}}}{{/vendorExtensions.x-modifiers}}):
raise ValueError(r"must validate the regular expression {{{vendorExtensions.x-pattern}}}")
return value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ def string_validate_regular_expression(cls, value):
if value is None:
return value

if not isinstance(value, str):
value = str(value)

if not re.match(r"[a-z]", value ,re.IGNORECASE):
raise ValueError(r"must validate the regular expression /[a-z]/i")
return value
Expand All @@ -66,6 +69,9 @@ def string_with_double_quote_pattern_validate_regular_expression(cls, value):
if value is None:
return value

if not isinstance(value, str):
value = str(value)

if not re.match(r"this is \"something\"", value):
raise ValueError(r"must validate the regular expression /this is \"something\"/")
return value
Expand All @@ -76,6 +82,9 @@ def pattern_with_digits_validate_regular_expression(cls, value):
if value is None:
return value

if not isinstance(value, str):
value = str(value)

if not re.match(r"^\d{10}$", value):
raise ValueError(r"must validate the regular expression /^\d{10}$/")
return value
Expand All @@ -86,6 +95,9 @@ def pattern_with_digits_and_delimiter_validate_regular_expression(cls, value):
if value is None:
return value

if not isinstance(value, str):
value = str(value)

if not re.match(r"^image_\d{1,3}$", value ,re.IGNORECASE):
raise ValueError(r"must validate the regular expression /^image_\d{1,3}$/i")
return value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ def name_validate_regular_expression(cls, value):
if value is None:
return value

if not isinstance(value, str):
value = str(value)

if not re.match(r"^[A-Z].*", value):
raise ValueError(r"must validate the regular expression /^[A-Z].*/")
return value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ def id_validate_regular_expression(cls, value):
if value is None:
return value

if not isinstance(value, str):
value = str(value)

if not re.match(r"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$", value):
raise ValueError(r"must validate the regular expression /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/")
return value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ def string_validate_regular_expression(cls, value):
if value is None:
return value

if not isinstance(value, str):
value = str(value)

if not re.match(r"[a-z]", value ,re.IGNORECASE):
raise ValueError(r"must validate the regular expression /[a-z]/i")
return value
Expand All @@ -66,6 +69,9 @@ def string_with_double_quote_pattern_validate_regular_expression(cls, value):
if value is None:
return value

if not isinstance(value, str):
value = str(value)

if not re.match(r"this is \"something\"", value):
raise ValueError(r"must validate the regular expression /this is \"something\"/")
return value
Expand All @@ -76,6 +82,9 @@ def pattern_with_digits_validate_regular_expression(cls, value):
if value is None:
return value

if not isinstance(value, str):
value = str(value)

if not re.match(r"^\d{10}$", value):
raise ValueError(r"must validate the regular expression /^\d{10}$/")
return value
Expand All @@ -86,6 +95,9 @@ def pattern_with_digits_and_delimiter_validate_regular_expression(cls, value):
if value is None:
return value

if not isinstance(value, str):
value = str(value)

if not re.match(r"^image_\d{1,3}$", value ,re.IGNORECASE):
raise ValueError(r"must validate the regular expression /^image_\d{1,3}$/i")
return value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ def name_validate_regular_expression(cls, value):
if value is None:
return value

if not isinstance(value, str):
value = str(value)

if not re.match(r"^[A-Z].*", value):
raise ValueError(r"must validate the regular expression /^[A-Z].*/")
return value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ def id_validate_regular_expression(cls, value):
if value is None:
return value

if not isinstance(value, str):
value = str(value)

if not re.match(r"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$", value):
raise ValueError(r"must validate the regular expression /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/")
return value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ def string_validate_regular_expression(cls, value):
if value is None:
return value

if not isinstance(value, str):
value = str(value)

if not re.match(r"[a-z]", value ,re.IGNORECASE):
raise ValueError(r"must validate the regular expression /[a-z]/i")
return value
Expand All @@ -67,6 +70,9 @@ def string_with_double_quote_pattern_validate_regular_expression(cls, value):
if value is None:
return value

if not isinstance(value, str):
value = str(value)

if not re.match(r"this is \"something\"", value):
raise ValueError(r"must validate the regular expression /this is \"something\"/")
return value
Expand All @@ -77,6 +83,9 @@ def pattern_with_digits_validate_regular_expression(cls, value):
if value is None:
return value

if not isinstance(value, str):
value = str(value)

if not re.match(r"^\d{10}$", value):
raise ValueError(r"must validate the regular expression /^\d{10}$/")
return value
Expand All @@ -87,6 +96,9 @@ def pattern_with_digits_and_delimiter_validate_regular_expression(cls, value):
if value is None:
return value

if not isinstance(value, str):
value = str(value)

if not re.match(r"^image_\d{1,3}$", value ,re.IGNORECASE):
raise ValueError(r"must validate the regular expression /^image_\d{1,3}$/i")
return value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ def name_validate_regular_expression(cls, value):
if value is None:
return value

if not isinstance(value, str):
value = str(value)

if not re.match(r"^[A-Z].*", value):
raise ValueError(r"must validate the regular expression /^[A-Z].*/")
return value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ def id_validate_regular_expression(cls, value):
if value is None:
return value

if not isinstance(value, str):
value = str(value)

if not re.match(r"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$", value):
raise ValueError(r"must validate the regular expression /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/")
return value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ def string_validate_regular_expression(cls, value):
if value is None:
return value

if not isinstance(value, str):
value = str(value)

if not re.match(r"[a-z]", value ,re.IGNORECASE):
raise ValueError(r"must validate the regular expression /[a-z]/i")
return value
Expand All @@ -67,6 +70,9 @@ def string_with_double_quote_pattern_validate_regular_expression(cls, value):
if value is None:
return value

if not isinstance(value, str):
value = str(value)

if not re.match(r"this is \"something\"", value):
raise ValueError(r"must validate the regular expression /this is \"something\"/")
return value
Expand All @@ -77,6 +83,9 @@ def pattern_with_digits_validate_regular_expression(cls, value):
if value is None:
return value

if not isinstance(value, str):
value = str(value)

if not re.match(r"^\d{10}$", value):
raise ValueError(r"must validate the regular expression /^\d{10}$/")
return value
Expand All @@ -87,6 +96,9 @@ def pattern_with_digits_and_delimiter_validate_regular_expression(cls, value):
if value is None:
return value

if not isinstance(value, str):
value = str(value)

if not re.match(r"^image_\d{1,3}$", value ,re.IGNORECASE):
raise ValueError(r"must validate the regular expression /^image_\d{1,3}$/i")
return value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ def name_validate_regular_expression(cls, value):
if value is None:
return value

if not isinstance(value, str):
value = str(value)

if not re.match(r"^[A-Z].*", value):
raise ValueError(r"must validate the regular expression /^[A-Z].*/")
return value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ def id_validate_regular_expression(cls, value):
if value is None:
return value

if not isinstance(value, str):
value = str(value)

if not re.match(r"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$", value):
raise ValueError(r"must validate the regular expression /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/")
return value
Expand Down
Loading