Skip to content

Update docs for response-model #1313

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

Closed
wants to merge 1 commit into from

Conversation

junhl
Copy link

@junhl junhl commented Feb 27, 2025

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.

Screenshot 2025-02-27 at 11 40 04 AM

@github-actions github-actions bot added the docs Improvements or additions to documentation label Feb 27, 2025

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`.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved For example, ... to new line like L33 for consistency.

Copy link

@svlandeg
Copy link
Member

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! 🙏

@svlandeg svlandeg closed this Feb 28, 2025
@junhl junhl deleted the fix-response-model-docs branch March 3, 2025 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants