-
Notifications
You must be signed in to change notification settings - Fork 14
[#H26] FastAPI HW #103
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
base: main
Are you sure you want to change the base?
[#H26] FastAPI HW #103
Conversation
Chudopal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Красиво сделано, многие идеи мне нравятся, функции небольшие, по большей части независимые, круто!
Исправь замечания или обоснуй, почему так как ты решил - более правильно будет, и можно мержить
| cats: int | ||
| dogs: int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Позволь пользователю вообще не задавать что-то, вдруг ему не интересны факты о собаках
|
|
||
|
|
||
| class ResponseInfo(BaseModel): | ||
| cats: tuple[str, ...] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ну этот тупо может содержать либо строку либо ничего, в модели этого не видно
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А как тогда правильно? list[str] ?
| DOGS_URL = 'http://dog-api.kinduff.com/api/facts' | ||
|
|
||
|
|
||
| async def get_facts(url: str, params: dict = None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
обычно в сигнатуре функций в проекте с FastAPI принято писать Optional[dict] или Union[dict, None], а не задавать явно None
No description provided.