I've added an "all-keys" REST query parameter which essentially overrides "keys" by returning the FC files with their entire metadata. This new parameter is intended to be a bool/flag. All enhancements are backwards compatible and tested.
This has several advantages:
Performance is increased considerably when querying /api/files versus multiple queries to api/file/<uuid>
This doesn't require the REST client/user to know what fields are available. That's useful since the file metadata schema varies among file types.
Individual REST routes can maintain their default keys when no "keys" parameter is included. Eg: api/file/<uuid> provides "logical_name" and "uuid" by default.
Notes:
argbuilder.py includes utility functions for constructing common arguments that are first parsed by urlargparse.parse()
"all-keys" is available for all routes where "keys" is. See argbuilder.py.
only /api/files/ has been tested so far
mongo.py has been updated, as well as type-hinted, formatted, and documented
an AllKeys instance is used as an indicator and to prevent convoluted multiple parameter logic.
I've added an
"all-keys"
REST query parameter which essentially overrides"keys"
by returning the FC files with their entire metadata. This new parameter is intended to be a bool/flag. All enhancements are backwards compatible and tested.This has several advantages:
/api/files
versus multiple queries toapi/file/<uuid>
"keys"
parameter is included. Eg:api/file/<uuid>
provides"logical_name"
and"uuid"
by default.Notes:
argbuilder.py
includes utility functions for constructing common arguments that are first parsed byurlargparse.parse()
"all-keys"
is available for all routes where"keys"
is. Seeargbuilder.py
./api/files/
has been tested so farmongo.py
has been updated, as well as type-hinted, formatted, and documentedAllKeys
instance is used as an indicator and to prevent convoluted multiple parameter logic.