Hi team, I have a question,
# spicedb
s
Hi team, I have a question, In relationship/read response, I see there is error message within a successful response as well; this is I looked at swagger; Was wondering what this error is about and which scenario it will have any value
v
sorry, are you referring to
ReadRelationships
? can you point me to the error in the swagger API?
Copy code
{
  "result": {
    "readAt": {
      "token": "string"
    },
    "relationship": {
      "resource": {
        "objectType": "string",
        "objectId": "string"
      },
      "relation": "string",
      "subject": {
        "object": {
          "objectType": "string",
          "objectId": "string"
        },
        "optionalRelation": "string"
      }
    }
  },
  "error": {
    "code": 0,
    "message": "string",
    "details": [
      {
        "@type": "string",
        "additionalProp1": "string",
        "additionalProp2": "string",
        "additionalProp3": "string"
      }
    ]
  }
}
v
ok yeah - I don't know for sure but given this is a streaming API, the HTTP exposed here follows JSON Lines: https://jsonlines.org/ So I suspect that, if it follows what's happening in gRPC, you should receive an error when the stream has completed to emit all results. So you should get an EOF kind of error. @Joey can you confirm?
j
no, there should be no error
that definition above shows there can be an error
v
so what's the behaviour when the stream ends?
how does the listener know it ended?
j
it stops sending things
s
Hi @Joey is there a doc where I can see all details and respective value for all the apis, eg; in above read api ; error- code; @type, additionalProp1 In write api; I see OptionType , I am looking for details on all these values and their use cases
s
Thanks Joey!
Hi @Joey , While setting consistency parameters in read operations; I getting error …api.consistency.requirements is already set. What does this mean, and where these requirements have been already set? Could u please explain
In error response; code num is 3
j
what is the actual error, in full?
s
Let me type here, can’t copy
{ code:3 Message: “proto: error parsing “atleastAsFresh” , one of authzed.api.v1.consistency.requirements is already set. Details: [] }
j
and what is the request payload?
s
{ consistency: { minimizeLatency: false, AtleastAsFresh: null, Atexactsnapshot: null, Fullycinsistent: true }, Relationshipfilter: {…} I changed a bit, not I getting same error for field Fully consistent
**now
j
you can't specify multiple consistency fields
it needs to be one and only one
s
Umm, didn’t get, I have just 1 in each payload
j
Copy code
minimizeLatency: false,
AtleastAsFresh: null,
Atexactsnapshot: null,
Fullycinsistent: true
that's four
you can only specify one
s
Hmm ok
j
if you want full consistency
just specify that one field