How to use the serpyco.nested_field function in serpyco

To help you get started, we’ve selected a few serpyco examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github algoo / hapic / example / fake_api / schema_serpyco.py View on Github external
@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'],
    )

serpyco

Fast serialization of dataclasses using Cython

MIT
Latest version published 7 months ago

Package Health Score

53 / 100
Full package analysis