forked from loafle/openapi-generator-original
* Bugfix: #19487: Fix SyntaxWarning * Fix a bug which generates SyntaxWarning * Chore: #19487: Generate sample
This commit is contained in:
parent
30e6612558
commit
43fd18935c
@ -147,7 +147,7 @@ class {{classname}}(Model):
|
||||
{{/minimum}}
|
||||
{{#pattern}}
|
||||
if {{name}} is not None and not re.search(r'{{{vendorExtensions.x-regex}}}', {{name}}{{#vendorExtensions.x-modifiers}}{{#-first}}, flags={{/-first}}re.{{.}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}): # noqa: E501
|
||||
raise ValueError("Invalid value for `{{name}}`, must be a follow pattern or equal to `{{{pattern}}}`") # noqa: E501
|
||||
raise ValueError(r"Invalid value for `{{name}}`, must be a follow pattern or equal to `{{{pattern}}}`") # noqa: E501
|
||||
{{/pattern}}
|
||||
{{#maxItems}}
|
||||
if {{name}} is not None and len({{name}}) > {{maxItems}}:
|
||||
|
@ -86,6 +86,6 @@ class Category(Model):
|
||||
:type name: str
|
||||
"""
|
||||
if name is not None and not re.search(r'^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$', name): # noqa: E501
|
||||
raise ValueError("Invalid value for `name`, must be a follow pattern or equal to `/^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$/`") # noqa: E501
|
||||
raise ValueError(r"Invalid value for `name`, must be a follow pattern or equal to `/^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$/`") # noqa: E501
|
||||
|
||||
self._name = name
|
||||
|
Loading…
x
Reference in New Issue
Block a user