Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix pydantic return type serializer to support lists #17

Merged
merged 2 commits into from
Jul 20, 2024
Merged

Conversation

thrau
Copy link
Member

@thrau thrau commented Jul 20, 2024

Motivation

I forgot to handle lists of pydantic models in #14. You can now do something like:

@route("/items")
def handler(_request: Request) -> list[MyItem]:
    return [
        MyItem(name="rolo", ...),
        MyItem(name="twiks", ...),
    ]

Changes

  • lists of pydantic models can now be returned from a handler using a handler_dispatcher

@thrau thrau merged commit b51ca31 into main Jul 20, 2024
3 checks passed
@thrau thrau deleted the fix-pydantic-lists branch July 20, 2024 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant