Sunagatov / Iced-Latte

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

GET product reviews request with an invalid value of param "product_rating" the system returns all product reviews. #330

Closed Prankurtiwari closed 1 month ago

Prankurtiwari commented 3 months ago

Problem

If "%" is pass then system doesn't receive it making List<Integer> productRating null, that passes all the validation and display all the relevant records.Link

Proposed Solution

Added a validation for null List<Integer> productRating so that user get the error message to add rating. If we want to pass actual "%" then the correct way is passing %25. FYI system request that request.

Ripple Effect

Adding that check will change the non required productRating as it is a required field now.

Problem in Hand

How backend system will distinguished CASE1: productRating = % CASE2: (productRating not sent) as for that system both are null.

Sunagatov commented 1 month ago

@Prankurtiwari Thank you for your contribution!