Open
Conversation
Contributor
|
Task linked: CU-86b1108nz DB - Create BOOKMARK Model |
ryanRATM
reviewed
Jul 22, 2024
| from datetime import datetime | ||
|
|
||
| class User(BaseModel): | ||
| id: str = Field(..., description="Unique identifier for the user") |
There was a problem hiding this comment.
your IDs should either be int or uuid.
Contributor
There was a problem hiding this comment.
id here should be a str, because MongoDB's ObjectId is not JSON serializable. @DerekGuijt plz, wrap str as a PyObjectId: PyObjectId = Annotated[str, BeforeValidator(str)]
khodizoda
reviewed
Jul 23, 2024
|
|
||
| class User(BaseModel): | ||
| id: str = Field(..., description="Unique identifier for the user") | ||
| email: EmailStr = Field(..., description="User's email address") |
Contributor
There was a problem hiding this comment.
email-validator is required to use EmailStr. Please add email-validator to the requirements.txt. Double check the correct package needed for email-validator.
khodizoda
requested changes
Jul 23, 2024
Contributor
khodizoda
left a comment
There was a problem hiding this comment.
Looks good! Please, address the comments and we can merge the PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This code is for the user model