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.body
in javaorg.json.JSONObject
format. -
paggingSupport
- optional, allows to specify paging information in therequest
-
Paging information is available in
paging
object with -
pageSize
representing size of requested page -
pageOffset
representing size number of page to be returned (first page has offset 1) -
request
is 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