bauerji / flask-pydantic

flask extension for integration with the awesome pydantic package
MIT License
368 stars 58 forks source link

Returning empty List instead of raising Exception if response is empty List #68

Open andrei-samofalov opened 1 year ago

andrei-samofalov commented 1 year ago

Hi! Noticed that when the result of a query to the database gives an empty value validation raises InvalidIterableOfModelsException. Though it would be better to return just empty list. What do you think about it?

https://github.com/bauerji/flask-pydantic/blob/4b9b7c657ed10a28bf84c156b4fcd0e61510ee75/flask_pydantic/core.py#L47

I can fix this in couple of days