Skip to content

Make it clearer that DirectThingClient actions don't require dependencies #122

@rwb27

Description

@rwb27

When a DirectThingClient is created (e.g. via a FastAPI dependency) any dependencies of its actions are added to the constructor. This means they don't need to be passed manually when the actions are called. However, because the actions accept **kwargs and simply pass that on to the underlying Thing object, if you do supply the dependencies there's no error.

It would be helpful to:

  • Check the docs make it clear dependencies need not be supplied
  • Check the kwargs don't contain dependencies
  • Consider improving client generation so the actions have the correct signature

The last point may take longer.

The reason **kwargs isn't checked carefully is that any unused **kwargs should get picked up by the function call to the underlying action. This won't happen for dependencies though, as dependencies in the incoming arguments will simply be overwritten when they are injected by the method on the DirectThingClient object.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions