When constructing an object via ObjectFactory based on an object spec, we can currently pass in literal values, and specify services. We can't however specify configuration variables. That would be needed to allow e.g. REST route handlers to depend on configuration.
The alternative is to request the MainConfig instance to be injected. This seems undesirable, because it constitutes a dependency on all configuration, where only specific configuration is needed/desired.
The mechanism for referencing config variables could be similar to the mechanism used to reference service instances.
Context: this came up when trying to make the cache duration for T245675 configurable.