Agreed. We just need to set it in the lookup context. Here is how formats are handled:

https://github.com/strzalek/rails/blob/a5c609f1290f2ca071f8980eb08f3529513bbdee/actionpack/lib/action_controller/metal/rendering.rb#L7