Reputation: 587
I do a Post with some parameters, but one of them returns "field required" and "value_error.missing", but the field is there and it has a value. See the output of Postman.
In schemas.py the fields are defined as follows:
class Message(BaseModel):
title: str
id: int
datim: Optional[datetime]
to_id: Optional[int]
from_id: Optional[int]
body: Optional[str]
class Config:
orm_mode = True
So why does it complain about 'body'?
Upvotes: 25
Views: 53153
Reputation: 587
It turned out I had an extra argument in my function for @app.post()
that was not used.
Removing that solved the problem.
Upvotes: 9
Reputation: 89
This is for anyone who still has issues with this, I had a one to one relationship but had not specified uselist=False
while defining the relationship.
Upvotes: 3