on-internet
← Community

Mapping issues from Sqlalchemy to Pydantic - from_orm failed

Stack Overflow ·

I'm trying to get my result dictonary from sqlalchemy automatically to the Pydantic output for Fastapi to maps using the from_orm method, but I always get a validation error. File "pydantic\main.py", line 508, in pydantic.main.BaseModel.from_orm pydantic.error_wrappers.ValidationError: 2 validation errors for Category name field required (type=value_error.missing) id field required (type=value_error.missing) If I create the objects with the Pydantic schema myself and add them to the list, the method works. What would I have to change for from_orm to work? Did I possibly miss something in the d

Comments

Sign in or sign up to comment and upvote.

No comments yet.