Add support for the new field expansion information in API payloads.
Review Request #10459 — Created March 20, 2019 and submitted
Review Board 4.0 is introducing metadata on expanded fields, in order to
help determine which fields have been expanded and what their original
resource mimetypes/URLs would be.This change adds this support to RBTools. Now, when accessing an
expanded field (and running with Review Board 4.0), the caller will see
a resource object rather than a simple field wrapper. As field access
behaves the same on both, this should be backwards-compatible, and will
now allow callers to invoke any methods that would normally be on the
resource.Currently, we don't return custom list resource subclasses, as the
currentListResource
expects to have a full payload containing item
counts and a nested list of items. We can revisit this down the road
if we begin to need this functionality, and are already set up to do so
in the field wrapping mechanisms.
Made use of this support in the new
rbt patch
code that's in development.Unit tests pass.
Summary | ID |
---|---|
baeba8777e2e018d7dc8a9eb8e21b3becec7881e |
- Change Summary:
-
Fixed the wrong exception being caught on field lookup.
- Commits:
-
Summary ID c9d6bb30dbdd038bef87f667b7a516d626789e3d baeba8777e2e018d7dc8a9eb8e21b3becec7881e - Diff:
-
Revision 2 (+728 -76)