forked from loafle/openapi-generator-original
[Python] refactor pydantic model methods into abstract python codegen (#16279)
* refactor methods from python client to abstract python codegen * refactor regular expression methods * more refactoring * more refactoring
This commit is contained in:
@@ -138,7 +138,7 @@ async def get_user_by_name(
|
||||
response_model_by_alias=True,
|
||||
)
|
||||
async def login_user(
|
||||
username: str = Query(None, description="The user name for login", regex=r"^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$"),
|
||||
username: str = Query(None, description="The user name for login", regex=r"/^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$/"),
|
||||
password: str = Query(None, description="The password for login in clear text"),
|
||||
) -> str:
|
||||
""""""
|
||||
|
||||
@@ -25,7 +25,7 @@ class Category(BaseModel):
|
||||
|
||||
@validator("name")
|
||||
def name_pattern(cls, value):
|
||||
assert value is not None and re.match(r"^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$", value)
|
||||
assert value is not None and re.match(r"/^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$/", value)
|
||||
return value
|
||||
|
||||
Category.update_forward_refs()
|
||||
|
||||
Reference in New Issue
Block a user