[All SDKs] Allow writes
and deletes
to accept empty arrays, but do not forward them to the server
#299
Labels
dotnet-sdk
Affects the C#/DotNet SDK
enhancement
New feature or request
go-sdk
Affects the Go SDK
good first issue
Good for newcomers
java-sdk
Affects the Java/Kotlin SDK
js-sdk
Affects the JavaScript SDK
python-sdk
Affects the Python SDK
The API currently enforces array lengths to be at least
1
when sent. sourceOn the SDK side, this provides a subpar developer experience.
Considering OpenFgaClient already wraps the API client, we should allow empty arrays, but do not send them to the server to improve the experience of users using the SDK so that they do not worry about this.
The idea is not to have the app short circuit when both Writes and Deletes are not provided, instead we want to add test and ensure that if they are an empty array, they are not sent (as fields) to the API.
So:
Write(writes=[tupleA], deletes=[tupleB])
Write(writes=[tupleA], deletes=[tupleB])
Write(writes=[], deletes=[tupleA])
Write(deletes=[tupleA])
Write(writes=[tupleA, deletes=[])
Write(writes=[tupleA])
Write(writes=[], deletes=[])
Write()
The text was updated successfully, but these errors were encountered: