Skip to content

Commit f6ed1ba

Browse files
authored
Rename LowerCaseModel to FlatCaseModel, as the naming convention is correctly called flat case (#41)
1 parent c255677 commit f6ed1ba

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/pythonxbox/api/provider/userstats/models.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from pythonxbox.common.models import LowerCaseModel, PascalCaseModel
1+
from pythonxbox.common.models import FlatCaseModel, PascalCaseModel
22

33

44
class GeneralStatsField:
@@ -17,7 +17,7 @@ class Properties(PascalCaseModel):
1717
display_name: str | None = None
1818

1919

20-
class Stat(LowerCaseModel):
20+
class Stat(FlatCaseModel):
2121
group_properties: GroupProperties | None = None
2222
xuid: str
2323
scid: str
@@ -27,18 +27,18 @@ class Stat(LowerCaseModel):
2727
properties: Properties
2828

2929

30-
class StatListsCollectionItem(LowerCaseModel):
30+
class StatListsCollectionItem(FlatCaseModel):
3131
arrange_by_field: str
3232
arrange_by_field_id: str
3333
stats: list[Stat]
3434

3535

36-
class Group(LowerCaseModel):
36+
class Group(FlatCaseModel):
3737
name: str
3838
title_id: str | None = None
3939
statlistscollection: list[StatListsCollectionItem]
4040

4141

42-
class UserStatsResponse(LowerCaseModel):
42+
class UserStatsResponse(FlatCaseModel):
4343
groups: list[Group] | None = None
4444
statlistscollection: list[StatListsCollectionItem]

src/pythonxbox/common/models.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
from pydantic.alias_generators import to_camel, to_pascal
55

66

7-
def to_lower(string: str) -> str:
8-
return string.replace("_", "")
7+
def to_flat(string: str) -> str:
8+
return string.lower().replace("_", "")
99

1010

1111
class PascalCaseModel(BaseModel):
@@ -20,7 +20,7 @@ class CamelCaseModel(BaseModel):
2020
)
2121

2222

23-
class LowerCaseModel(BaseModel):
23+
class FlatCaseModel(BaseModel):
2424
model_config = ConfigDict(
25-
arbitrary_types_allowed=True, populate_by_name=True, alias_generator=to_lower
25+
arbitrary_types_allowed=True, populate_by_name=True, alias_generator=to_flat
2626
)

0 commit comments

Comments
 (0)