Is your feature request related to a problem? Please describe.
ThingServer.__init__ has several arguments that are passed internally to ThingServerConfig(). Currently, the only way to use an instance of ThingServerConfig is to pass it to ThingServer.from_config which dumps it to a dictionary and then re-creates it in ThingServer.__init__.
This results in several places that all list the arguments to ThingServerConfig and some ugly code.
Describe the solution you'd like
ThingServer.__init__ should be able to accept a ThingServerConfig which is then used directly, without further processing. It should still be able to accept things and other arguments, probably using **kwargs.
Mostly, this just deduplicates the code, but it also means that subclassed config models will stay as instances of the subclass, rather than reverted to a base ThingServerConfig instance. This ought to make life easier for downstream code that wants to define a model for application_config.
Is your feature request related to a problem? Please describe.
ThingServer.__init__has several arguments that are passed internally toThingServerConfig(). Currently, the only way to use an instance ofThingServerConfigis to pass it toThingServer.from_configwhich dumps it to a dictionary and then re-creates it inThingServer.__init__.This results in several places that all list the arguments to
ThingServerConfigand some ugly code.Describe the solution you'd like
ThingServer.__init__should be able to accept aThingServerConfigwhich is then used directly, without further processing. It should still be able to acceptthingsand other arguments, probably using**kwargs.Mostly, this just deduplicates the code, but it also means that subclassed config models will stay as instances of the subclass, rather than reverted to a base
ThingServerConfiginstance. This ought to make life easier for downstream code that wants to define a model forapplication_config.