Swarm API - how to specify image affinity?

Hi,

I’ve been looking for documentation on how to construct a REST call to Swarm so we can specifiy image affinity. Does any know how?

The docs mention using docker CLI via -e affinity:image=…, but how does this look in the payload body of a create container call?