#Hello World Expanded Example > InvalidAnnotationException

1 messages · Page 1 of 1 (latest)

crisp oracle
#

I'm trying to run the docs "Expanded Example" found here: https://docs.litestar.dev/latest/

When I run it I get:
litestar.exceptions.dto_exceptions.InvalidAnnotationException: DTO narrowed with '<class 'my_app.models.User'>', handler type is '<class 'my_app.models.PartialUserDTO'>'

My file structure is as follows:

├── app.py
├── my_app
│   ├── controllers
│   │   └── user.py
│   ├── models.py

Is there something about the directory/file structure that is causing this? I was unclear where to copy past the code in the example.

hardy galleon
crisp oracle
hardy galleon
#

Thanks for the doc PR 🙂 left a small comment there, if it does not make sense to you feel free to discuss here

crisp oracle
#

Hey, sorry, just saw here. Anyways, thanks for your help! I'm sure I'll have more stuff I need help with haha

hardy galleon
#

Feel free to ask, there are a lot more users (better users than me) who can help you with all sorts of things 😇

#

also, mark this as solved then? so that other users don't end up revisiting this