Skip to content

Change attributes names of models #1

@namanUIUC

Description

@namanUIUC

Model classes built on BaseModel class are having conflict with their attributes and another class with the same name when we do hashing (for schema generation)

Change this :

class SomeClass(BaseModel):
    BigApple: int = 0

to this:

def to_camel(string: str) -> str:
    return ''.join(word.capitalize() for word in string.split('_'))


class SomeClass(BaseModel):
    big_apple: int = 0
    class Config:
        alias_generator = to_camel

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions