With the same body and configurations, the docker container shows a 422 error. However, if I run the same FastAPI service on my PC (without Docker), I can successfully get my results.
Postman throws the following error when pinging the container:
{
"detail": [
{
"loc": [
"body"
],
"msg": "value is not a valid dict",
"type": "type_error.dict"
}
]
}
For reference, this is the function in conflict:
@router.post("/get_NERs")
def get_NERs(self, artrel: ArticleRelevance):
return artrel.dict()
Where ArticleRelevance is:
class ArticleRelevance(BaseModel):
title: str
comments: List[str]
I am successfully able to ping GET functions from the same docker container so I know the routing isn't an issue.