bramqp icon indicating copy to clipboard operation
bramqp copied to clipboard

Clarify table type syntax in documentation / examples

Open gr4per opened this issue 6 years ago • 1 comments

Actually all methods that take arbitrary properties require them to be of "table" type. Example is content properties.headers

This means you can't pass in a plain js object, but actually have to type the values, e.g. turn it to a key value map where the value is {type: "$oneOfValueTypes", data: "$theValue"}

I guess putting it in one of the examples would help people understand (I thought this is not obvious)

Cheers, Arne

gr4per avatar Jul 18 '18 12:07 gr4per

Not all fields have this need to be setup as a table type. Content's headers field is a domain="table" so it has to be this way. The documentation for the table type already exists but could use some work. More examples with this would probably be good.

I have also thought of some system to allow for more loose type definitions to prevent the need to have these explicit types listed but I have not pursued it as the explicit typing does work and is unambiguous.

bakkerthehacker avatar Jul 18 '18 20:07 bakkerthehacker