On Tue, Sep 4, 2018 at 9:44 PM Chanaka Jayasena <[email protected]> wrote:
> Hi,
>
> I am updating API rating from 5 star rating to 10 star rating base on the
> set of usability improvements we are planning for store.
>
When migrating from API Manager 2 to 3, this would mean that we have to
multiply the rating value from 2 to fit into the 10 start rating scale.
>
> I am also updating the Rest API to support the same.
>
> Get operation of rating API is returning the following object format.
>
> 1. avgRating:"4"
> 2. count:1
> 3. list:[{…}]
> 4. userRating:"4"
>
> Put operation to the Rating api returns the following.
>
> 1. rating: 5
> 2. ratingId:"5f31ff42-1bc0-4295-8123-189dd34499dc"
> 3. username:"admin"
>
> Returning the userRating along with the response of the PUT operation will
> remove the need for a second call to get the average rating to update the
> UI.
>
> Will it break the RESTFull ness of the API, if I do this change?
>
I don't think so. If the GET operation returns the userRating I guess its
fine for the PUT operation to return it too.
Why are the responses of the GET and PUT operations very different? Ex:
count, list are missing in PUT, ratingId is missing in GET.
>
> thanks,
> Chanaka
> --
> Chanaka Jayasena
> Associate Tech Lead,
> email: [email protected]; cell: +94 77 4464006
> blog: http://chanaka3d.blogspot.com
>
--
Nuwan Dias
Director - WSO2, Inc. http://wso2.com
email : [email protected]
Phone : +94 777 775 729
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture