objectClass("User") {
search {
endpoint("/users/search") {
objectExtractor {
return response.body.get("users")
}
pagingSupport {
request.queryParameter("size", paging.pageSize)
.queryParameter("offset", paging.pageOffset)
}
}
}
}
Basic User Search
Write a Groovy script User.search.groovy which handles search of the
object class User.
The Groovy script should look like:
Where:
-
endpoint- method takes an search / list endpoint as an argument. -
objectExtractor- optional, it is used to extract a list of objects fromresponse.bodyin javaorg.json.JSONObjectformat. -
paggingSupport- optional, allows to specify paging information in therequest -
Paging information is available in
pagingobject with -
pageSizerepresenting size of requested page -
pageOffsetrepresenting size number of page to be returned (first page has offset 1) -
requestis object used to customize request. You can usequeryParamater(name, value)to add HTTP query parameters to request.
Was this page helpful?
YES
NO
Thanks for your feedback