Commit a9dcd5e5 authored by Jo Sama's avatar Jo Sama 😱
Browse files

roleAndCompany has been pluralized again

This fix has minimal impact in terms of LOC, so it can be fixed easily
the next time..
parent 8f67eced
Pipeline #48420 failed with stage
in 2 minutes and 27 seconds
......@@ -590,6 +590,15 @@ class Usage(BaseModel):
allow_population_by_field_name = True
def bruker_model_to_lower_camel(s: str) -> str:
"""Alias generator to avoid breaking PEP8"""
if s == 'role_and_company':
return 'rolesAndCompanies'
first, *others = s.split("_")
return "".join([first.lower(), *map(str.capitalize, others)])
class Bruker(BaseModel):
user_id: str
user_name: str
......@@ -603,7 +612,7 @@ class Bruker(BaseModel):
role_and_company: typing.Optional[typing.List[RoleAndCompany]]
class Config:
alias_generator = to_lower_camel
alias_generator = bruker_model_to_lower_camel
allow_population_by_field_name = True
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment