Hi Harshan, Not only these parameters should be required, they should be validated in terms of the values provided.
For example: [1] Neither offset nor limit should be minus values. [2] There should be a maximum limit enforced such that limits beyond that would not be permitted and it should be configurable. Cheers, Dilan. *Dilan U. Ariyaratne* Senior Software Engineer WSO2 Inc. <http://wso2.com/> Mobile: +94766405580 <%2B94766405580> lean . enterprise . middleware On Fri, Jul 29, 2016 at 6:42 PM, Harshan Liyanage <hars...@wso2.com> wrote: > Hi all, > > Following issue [1] can be observed in latest EMM pack (with Mysql setup) > when we invoke the "/api/device-mgt/v1.0/devices" API to fetch devices. > This is happening because we set the limit and offset as 0,0 to the device > fetch query if the limit and offset query params are not provided. In MySql > this query will return an empty set and the API response will look like > below. > > { > "devices": [], > "count": 10 > } > > Due to this issue all the paginated APIs will be RESTfully wrong (as those > APIs won't return any data other than the count) if we don't provide the > limit and offset parameters to them. On the otherhand we can't return all > the matching resources for APIs like /devices, /users because there might > be 1000's of devices or users and it'll consume lot of server resources to > generate such a response. > > So shall we do the $subject? WDYT ? > > [1]. https://wso2.org/jira/browse/EMM-1424 > > Thanks, > > Harshan Liyanage > Senior Software Engineer > Mobile: *+94765672894* > Email: hars...@wso2.com > Blog : http://harshanliyanage.blogspot.com/ > *WSO2, Inc. :** wso2.com <http://wso2.com/>* > lean.enterprise.middleware. >
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev