| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| We can also use other type annotations, the same way we can use with Pydantic fields. | ||
|
|
||
| First, we import `List` from `typing` and then we declare the `response_model` with `List[Hero]`: | ||
| For example, we can pass a list of `Hero`s to `response_model`. |
There was a problem hiding this comment.
Moved For example, ... to new line like L33 for consistency.
Sorry, something went wrong.
|
📝 Docs preview for commit 5935199 at: https://af6de111.sqlmodel.pages.dev Modified Pages |
Sorry, something went wrong.
|
Hi @junhl, thanks for contributing to sqlmodel! You're right, and there's already an open PR to address this: #1147 As the existing PR also includes additional cases that can be updated, we can continue the discussion there and I'll close this one. But thanks again! 🙏 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
As of Python 3.9, you no longer have to use List from typing for type hinting.
The code example is updated but there is a sentence that was not updated accordingly in docs.