'How do i ensure that data(str) received from body in fastapi is not empty

id:str,
data: str = Body(...,embed=true,min_length=1)

I have tried to use min length but i would like to know if there is any other to ensure that received data from body is not empty.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source