Skip to content

IDEA: Composable schemas #3

@kuyugama

Description

@kuyugama

Proposed design:

user_schema = schema("User", ...)
content_schema = schema("Content", ...)

pagination_info_schema = schema("PaginationInfo", ...)
paginated_schema = schema("Paginated", field(pagination_info_schema, "info"), field(list[user_schema | content_schema], "items"))

Also, would be good to have some type of generic.
Prototype design is this:

generic_schema = schema("Generic", generic_field, field(str, "title"))

owned_content = generic_schema[field(user_schema, "owner")]

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions