Skip to content

Commit

Permalink
chore: add test to cover not sending empty array when other has data (
Browse files Browse the repository at this point in the history
…#75)

* docs: update read doc string

* fix: fix example makefile to run openfga

Co-authored-by: Jim Anderson <[email protected]>

* chore: add test to cover not sending empty array when other has data

---------

Co-authored-by: Jim Anderson <[email protected]>
  • Loading branch information
ewanharris and jimmyjames authored Feb 12, 2024
1 parent 60fc2a1 commit f7429ac
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
8 changes: 6 additions & 2 deletions api_open_fga.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,9 @@ type OpenFgaApi interface {

/*
* Read Get tuples from the store that matches a query, without following userset rewrite rules
* The Read API will return the tuples for a certain store that match a query filter specified in the body of the request. It is different from the `/stores/{store_id}/expand` API in that it only returns relationship tuples that are stored in the system and satisfy the query.
* The Read API will return the tuples for a certain store that match a query filter specified in the body of the request.
The API doesn't guarantee order by any field.
It is different from the `/stores/{store_id}/expand` API in that it only returns relationship tuples that are stored in the system and satisfy the query.
In the body:
1. `tuple_key` is optional. If not specified, it will return all tuples in the store.
2. `tuple_key.object` is mandatory if `tuple_key` is specified. It can be a full object (e.g., `type:object_id`) or type only (e.g., `type:`).
Expand Down Expand Up @@ -2544,8 +2546,10 @@ func (r ApiReadRequest) Execute() (ReadResponse, *_nethttp.Response, error) {

/*
- Read Get tuples from the store that matches a query, without following userset rewrite rules
- The Read API will return the tuples for a certain store that match a query filter specified in the body of the request. It is different from the `/stores/{store_id}/expand` API in that it only returns relationship tuples that are stored in the system and satisfy the query.
- The Read API will return the tuples for a certain store that match a query filter specified in the body of the request.
The API doesn't guarantee order by any field.
It is different from the `/stores/{store_id}/expand` API in that it only returns relationship tuples that are stored in the system and satisfy the query.
In the body:
1. `tuple_key` is optional. If not specified, it will return all tuples in the store.
2. `tuple_key.object` is mandatory if `tuple_key` is specified. It can be a full object (e.g., `type:object_id`) or type only (e.g., `type:`).
Expand Down
1 change: 1 addition & 0 deletions client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,7 @@ func TestOpenFgaClient(t *testing.T) {
Relation: "viewer",
Object: "document:roadmap",
}},
Deletes: []ClientTupleKeyWithoutCondition{},
}
options := ClientWriteOptions{
AuthorizationModelId: openfga.PtrString("01GAHCE4YVKPQEKZQHT2R89MQV"),
Expand Down
2 changes: 1 addition & 1 deletion example/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ run: restore

run-openfga:
docker pull docker.io/openfga/openfga:${openfga_version} && \
docker run -p 8080:8080 docker.io/openfga/openfga:${openfga_version}
docker run -p 8080:8080 docker.io/openfga/openfga:${openfga_version} run

0 comments on commit f7429ac

Please sign in to comment.