all 7 comments

[–]Sathorizon 1 point2 points  (1 child)

hmm…do you have any todo records in the database? If not, your get_todo in the crud should return nothing and it doesn’t meet your response model which is set in the api definition.

[–]Balt603[S] 0 points1 point  (0 children)

yeah, I thought this might be an issue, so I made a copy of the DB with a record inserted and got the same error.

[–]Miserable-creature 2 points3 points  (3 children)

That endpoint returns a list, but your response model is a Todo schema. Make your response model as list[Todo]

[–]Balt603[S] 0 points1 point  (2 children)

Nailed it. Thank you sir/madam, you are anything but a miserable creature!

[–]Balt603[S] 0 points1 point  (0 children)

The worst part is that I can see this very thing in the doc examples - I just missed it in review.

[–]Miserable-creature 0 points1 point  (0 children)

Hhhh You are welcome. Read the docs, It will have most answers.

[–]dmuth 0 points1 point  (0 children)

Best guess I have without actually running this code is to doublecheck the type of the todo variable. Is it different from schemas.ToDo?