Sunagatov / Iced-Latte

a online Marketplace for coffee retail (Backend)
https://iced-latte.uk
MIT License
587 stars 95 forks source link

averageRating getting from 2 endpoints has a different data type. #306

Open TetianaPerinha opened 1 month ago

TetianaPerinha commented 1 month ago

Describe the bug Product averageRating getting from endpoints - /api/v1/products and /api/v1/products/{productId}/reviews/statistics has different data type.

/api/v1/products/{productId}/reviews/statistics has "avgRating": "string" - <class 'str'> /api/v1/products has "averageRating": 0 - <class 'float'>

barkev01 commented 1 month ago

I can't seem to find the ProductInfoDto class file. Maybe the avgRating field in the DTO is a String ?

TetianaPerinha commented 1 month ago

I can't seem to find the ProductInfoDto class file. Maybe the avgRating field in the DTO is a String ?

I compared the avgRating from JSON responses and got an error in a test that I tried to compare a different type of data.