Error adding reviews with API!

Hi,

I´m new to Sylius. Awesome at all. Working fine with the API (from iOS App with Swift). All fine except when tryin to create a review for a product. When i try do this, i get this error:

{
    "code": 400,
    "message": "Validation Failed",
    "errors": {
        "children": {
            "rating": {
                "children": [
                    {},
                    {},
                    {},
                    {},
                    {}
                ]
            },
            "title": {},
            "comment": {},
            "author": {
                "children": {
                    "email": {
                        "errors": [
                            "This email is already registered, please login or use forgotten password."
                        ]
                    }
                }
            }
        }
    }
}

i do a method for auth user programatically, i see cookies in postman, etc. but the api continue returning error, for the moment only when writing a review via api.

Any help with this please ??

Can you show your request data values please?

This is the endpoint i’m consuming:

api/v1/products/one_product/reviews/

and this is the request body:

{
    "title": "A product review",
    "rating": "3",
    "comment": "This is a comment review",
    "author": {
        "email": "someuser@gmail.com"
    }
}

someuser@gmail.com exist in DB and is registered & active (i can login with this user from website). I can write reviews from in the product page, but when consuming api (from postman and from iOS app) i receive the error i show up.

Help with this please ?, i’m new to Sylius i can’t achieve this alone !

This occurs because UniqueReviewerEmail constraint validator is mapped to Sylius\Component\Review\Model\Review entity, see https://github.com/Sylius/Sylius/blob/1.6/src/Sylius/Bundle/CoreBundle/Resources/config/validation/ProductReview.xml . One way is to change validation group sylius_review to another one in your form. More about it in validation customizing article

Awesome, thanks i will try and let u know when finish !