Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
class AboutSchema(object):
""" Representation of the /about route """
version: str
datetime: datetime
@dataclasses.dataclass
class UserIdPathSchema(object):
"""
representation of a user id in the uri. This allow to define rules for
what is expected. For example, you may want to limit id to number between
1 and 999
"""
id: int = number_field(minimum=1, cast_on_load=True)
@dataclasses.dataclass
class UserSchema(object):
"""Complete representation of a user"""
first_name: str
last_name: typing.Optional[str]
display_name: str
company: typing.Optional[str]
id: int
email_address: str = string_field(format_=StringFormat.EMAIL)
@dataclasses.dataclass
class UserDigestSchema(object):
id: typing.Optional[int] = None # Note: must be optional to be unused in POST user
@dataclasses.dataclass
class PaginationSchema(object):
"""A docstring to prevent auto generated docstring"""
first_id: int
last_id: int
current_id: int
@dataclasses.dataclass
class ListsUserSchema(object):
"""A docstring to prevent auto generated docstring"""
pagination: PaginationSchema
item_nb: int = number_field(minimum=0)
items: typing.List[UserSchema] = nested_field(
only=['id', 'username', 'display_name', 'company'],
)
@dataclasses.dataclass
class NoContentSchema(object):
"""A docstring to prevent auto generated docstring"""
@dataclasses.dataclass
class AboutResponseSchema(object):
"""A docstring to prevent auto generated docstring"""
version: str
datetime: datetime
@dataclasses.dataclass
class UserPathSchema(object):
"""A docstring to prevent auto generated docstring"""
id: int = number_field(minimum=1, cast_on_load=True)
@dataclasses.dataclass
class UserSchema(object):
"""A docstring to prevent auto generated docstring"""
first_name: str
last_name: str
display_name: str
company: str
username: str = string_field(pattern='[\w-]+')
email_address: str = string_field(format_=StringFormat.EMAIL)
id: typing.Optional[int] = None # Note: must be optional to be unused in POST user
@dataclasses.dataclass
class PaginationSchema(object):