Peter Xu <pet...@redhat.com> writes: > On Wed, Mar 23, 2016 at 10:52:29AM +0100, Markus Armbruster wrote: >> The rule against returning non-dictionaries exists to avoid interfaces >> that cannot evolve. With a dictionary, you can evolve by adding >> members. >> >> The rule does *not* forbid returning lists of dictionaries. When a >> command fundamentally returns a list of things, being able to evolve the >> things suffices. > > Ok. > >> >> query-gic-capabilities looks like it fundamentally returns a list of >> capabilities. Returning ['GICCapability'] is just fine then. > > I have posted v6 just as Eric has suggested. At least one advantage > is that it is easier to be extended (if needed) in the future, also > to follow the more-generic format to use dicts rather than > arrays. If you would not mind, I'll keep the dict interface there.
Returning such a list of a structured type is a well-established convention by now --- qmp-introspect.c shows 28 commands doing it, most of them named query-FOO. I'd rather not start a different convention now, just because we got temporarily confused about our own rules. So, unless there's something about query-gic-capabilities that makes it more likely to need extension outside its list element type, let's stick to returning the list. Eric? > > [...] > >> In either case, drop the change to returns_whitelist. > > Yep. Dropped in v6. > > Thanks. > > -- peterx