Add support for the new field expansion information in API payloads.

Review Request #10459 — Created March 20, 2019 and submitted — Latest diff uploaded

Information

RBTools
master

Reviewers

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
current ListResource 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.

Commits

Files