You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this change (included in 0.1.6), the types of the fields on the Client struct were changed from interfaces to concrete types. This breaks any unit or integration tests which rely on providing mock implementations of the various fields in order to avoid calling a live 1Password service (related: #98).
DWSR
changed the title
Fields on Client struct changed from interfaces to structs
Fields on Client struct changed from interfaces to structs in 0.1.6
Jan 12, 2025
Making sure that our SDKs are testable is a priority for us. It looks like, in making this change, we did not consider the use-cases for custom implementations of the APIs within the SDKs.
Thanks for sharing your implementation of the MockResolver - we're going to look into making this switch back to the top-level fields of the client being injectable interfaces and we will keep you posted with our decisions and work on this.
In the meantime, given you only use one function within the SDK, would a workaround such as wrapping the entire 1Password client in an interface with multiple implementations in your code be suitable?
Scenario & Reproduction Steps
In this change (included in 0.1.6), the types of the fields on the Client struct were changed from interfaces to concrete types. This breaks any unit or integration tests which rely on providing mock implementations of the various fields in order to avoid calling a live 1Password service (related: #98).
As an example, I wrote a MockResolver so that I could test my code like this.
Given that this file is auto-generated, I expect this is due to a change in the generation code.
Actual Behavior
The fields are structs, not interfaces
Expected Behavior
The fields should be interfaces.
SDK version
0.1.6
Additional information
No response
The text was updated successfully, but these errors were encountered: