This is causing unit test failures in Gerrit change 182858, which among other things is making the API behave more sensibly when passed objects.
Discussion on IRC with @EBernhardson suggested two possibilities:
- Flow could just do the appropriate conversion before passing its UUID into ApiResult
- Some sort of "ApiSerializable" interface, like PHP's JsonSerializable. This has been added to Gerrit change 182858 in PS17, but would still need implementation by Flow in its UUID class and conditional handling in its unit test until that change is merged.