Change opcode/luxi showJSON generation in THH
Change opcode/luxi showJSON generation in THH

Currently, the opcode and luxi "showJSON" functions generate directly
a JSValue; in contrast, the object (single-constructor) types generate
a 'toDict' function, and then `showJSON = makeObj . toDict`. This is
useful, as the 'dict' form can be manipulated if needed.

This patch changes the opcode and luxi types to behave the same; we
generate a dict, and then (since this differs between opcodes and
luxi) generate showJSON either as `makeObj . toDict` (for opcodes), or
(for luxi) `showJSON . map sn . toDict`.

The change is needed for MetaOpCode implementation.

Signed-off-by: Iustin Pop <acf83a5274f31a43af6b914614365999469c1a31@google.com>
Reviewed-by: Guido Trotter <f62ca4d5358bdaeef0e50e57f9f7e231de63727e@google.com>

dimara/ganeti,leshchevds/ganeti,grnet/snf-ganeti,dimara/ganeti,apyrgio/ganeti,bitemyapp/ganeti,andir/ganeti,apyrgio/snf-ganeti,ganeti-github-testing/ganeti-test-1,ganeti/ganeti,mbakke/ganeti,grnet/snf-ganeti,ganeti-github-testing/ganeti-test-1,apyrgio/snf-ganeti,yiannist/ganeti,mbakke/ganeti,mbakke/ganeti,ganeti/ganeti,andir/ganeti,leshchevds/ganeti,andir/ganeti,leshchevds/ganeti,bitemyapp/ganeti,ganeti/ganeti,apyrgio/ganeti,yiannist/ganeti,onponomarev/ganeti,yiannist/ganeti,onponomarev/ganeti