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
I am using an object I created with the ClientTupleKey type for both write operation and delete operation, but I encounter a type error for delete operation.
The method deletes(List) in the type ClientWriteRequest is not applicable for the arguments (List) Java(67108979)
package dev.openfga.sdk.api.client.model;
import java.util.List;
public class ClientWriteRequest {
private List<ClientTupleKey> writes;
private List<ClientTupleKeyWithoutCondition> deletes;
public ClientWriteRequest() {
}
public static ClientWriteRequest ofWrites(List<ClientTupleKey> writes) {
return (new ClientWriteRequest()).writes(writes);
}
public ClientWriteRequest writes(List<ClientTupleKey> writes) {
this.writes = writes;
return this;
}
public List<ClientTupleKey> getWrites() {
return this.writes;
}
public static ClientWriteRequest ofDeletes(List<ClientTupleKeyWithoutCondition> deletes) {
return (new ClientWriteRequest()).deletes(deletes);
}
public ClientWriteRequest deletes(List<ClientTupleKeyWithoutCondition> deletes) {
this.deletes = deletes;
return this;
}
public List<ClientTupleKeyWithoutCondition> getDeletes() {
return this.deletes;
}
}
Expectation
The arguments of the delete api must have the same type as the arguments of the write api.
If I am understanding correctly, you are expecting that the tuple arguments for write and delete are the same. However, the schema for writes vs. delete is actually different, hence the different argument types. The write schema looks like this, notice the different types for the argument to write versus delete (because write accepts a condition param, but delete does not):
As the models are generated from the API schema, we see that the SDK type is consistent with the API schema. Hope that helps clear up any confusion!
Hi @jimmyjames I actually expect it to accept the same type conversions as in the .NET SDK, because there is no condition in the tuples value I create with ClientTupleKey and I waste time doing type conversions when I want to delete. If you examine the example I gave, I create the tuples with ClientTupleKey when the event is delete or write, but if it is delete, I have to do a type conversion.
Checklist
Description
I am using an object I created with the ClientTupleKey type for both write operation and delete operation, but I encounter a type error for delete operation.
Expectation
The arguments of the delete api must have the same type as the arguments of the write api.
Reproduction
OpenFGA SDK version
0.5.0
OpenFGA version
1.5.7
SDK Configuration
Logs
No response
References
No response
The text was updated successfully, but these errors were encountered: