Open ramfox opened 2 years ago
filtering:
Avoid filtering for now! needs research (microsoft, open api, elasticsearch)
Note, by dustin, it is an anti-pattern to allow enormous limits for limit
KASEY REMEMBER TO ADD BREAKING CHANGE NOTES IN COMMIT WHEN YOU REMOVE PAGE/PAGESIZE
List Params
What is the best way to organize our list params, both below lib, as consumed by lib, and in the API
Needs:
discussion
Limit, offset
Get
requestsapiutil.Page
is used in cmd (log, list, peers, search, get)Filters
params.List
, since we can filter by any arbitrary field in any desired way/list?workflow=true&commitTime=>2021-11-05
/list?filter=workflow eq true and commitTime gt 2021-11-04&order=+name
/list?filter=workflow:true,commitTime:>2021-11-04&order=+name
params.List
into the specific structSort
?order=-updated,+name
?order=updated[DESC],name[ASC]
?order_by=created,ASC,name,DESC
?orderBy[name]=ASC&orderBy[created]=DESC
I think I personally like the first one since it seems easier to type for the user
params.List
ParamsFromRequest
(or some other name), that parses the query and turns it into a list params, overriding any params already in the structListParam
interface, that onlyparams.List
satisfies. Or we use type assertion.Order
field becomes slice ofOrder
structFilter
field becomes list ofFilter
structLib/http
DecodeParams
, add check for new interfaceListParam
, callingParamsFromRequest
that will pull any url query params into the list paramsparams.List
into all listing params: