[Fiware-developer-experience] Doubt about update reviews

Alberto Martín Casado alberto.martin at bitergia.com
Tue May 10 17:38:30 CEST 2016


Hi Pablo,

I've been testing this and you were right, the behavior was unexpected.
After checking how we PATCH the review's entities and the new model, I've
just found that, 'reviewRating' is being stored in Orion model without
using 'ratingValue'. As the PATCH is being done with the 'keyValues' option
enabled, the review rating should be updated like:

{
"reviewRating": 3
}

I'll update now the API specification. Sorry for the inconvenience!

Best,


Alberto Martín

On Tue, May 10, 2016 at 2:30 PM, Pablo Fernández Moniz <
pablofernandezmoniz at gmail.com> wrote:

> Hi!
>
> We are adapting the client to the new data model and we have a doubt about
> how to update a review.
>
> We were using the following data format to update a review:
>
> data = {
>       'reviewBody': '' + reviewBody,
>       'reviewRating': {
>         '@type': 'Rating',
>         'ratingValue': parseInt(ratingValue, 10)
>       }
>     };
>
> In spite of returning a 204 successful code, it corrupts the value ().
>
> So we have taken a look again to the API definition
> http://docs.tourguide.apiary.io/#reference/api-especification-for-tourguide/review/update-reviewand
> we found that the expected data format is:
>
> {
>   "reviewRating": {
>     "ratingValue": 3
>   }
> }
>
> We have tried it, and the data corruption remains.
>
> [data_before_update.png] shows how the data was before perform the update.
> [patch_request.png] illustrates the performed request in the Firefox
> developer tools.
>
>
> Regards,
>
> FIWAREULPGC,
>
> _______________________________________________
> Fiware-developer-experience mailing list
> Fiware-developer-experience at lists.fiware.org
> https://lists.fiware.org/listinfo/fiware-developer-experience
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.fiware.org/private/fiware-developer-experience/attachments/20160510/d6e52864/attachment.html>


More information about the Fiware-developer-experience mailing list

You can get more information about our cookies and privacy policies clicking on the following links: Privacy policy   Cookies policy