You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@router.get("/{id}", response_model=schemas.UserOut)defget_user(id: int, db: Session=Depends(get_db)):
user=db.query(models.User).filter(models.User.id==id).first()
ifnotuser:
raiseHTTPException(status_code=status.HTTP_404_NOT_FOUND, detail=" this id is not found")
return {"message": user}
in serialize_response
raise ValidationError(errors, field.type_)
pydantic.error_wrappers.ValidationError: 3 validation errors for UserOut
response -> id
field required (type=value_error.missing)
response -> email
field required (type=value_error.missing)
response -> created_at
field required (type=value_error.missing)
Question :
am I missing something here, i did the samething but i still get this error.
The text was updated successfully, but these errors were encountered:
I was trying to do the same what you did with the response_model and i created
Schema
Model
Router
Libs
Error :
Question :
am I missing something here, i did the samething but i still get this error.
The text was updated successfully, but these errors were encountered: