https://authzed.com logo
#spicedb
Title
# spicedb
g

gagahhag

05/01/2023, 12:47 PM
Got a question regarding REST API calls: It seems the endpoint
/v1/permissions/resource
as well as
/v1/permissions/subjects
doesn't produce valid JSON as reply. Shouldn't the response be an array of
v1LookupResourcesResponse
objects? It seems, that also the OpenAPI spec is wrong for thos two endpoints. The actual result is a concatenated string of these objects and not valid JSON:
Copy code
{
    "result": {
        "lookedUpAt": {
            "token": "GhUKEzE2ODI5NDI2NjAwMDAwMDAwMDA="
        },
        "resourceObjectId": "id1",
        "permissionship": "LOOKUP_PERMISSIONSHIP_HAS_PERMISSION",
        "partialCaveatInfo": null
    }
}{
    "result": {
        "lookedUpAt": {
            "token": "GhUKEzE2ODI5NDI2NjAwMDAwMDAwMDA="
        },
        "resourceObjectId": "id2",
        "permissionship": "LOOKUP_PERMISSIONSHIP_HAS_PERMISSION",
        "partialCaveatInfo": null
    }
}
A correct reply shoult look like this:
Copy code
[{
    "result": {
        "lookedUpAt": {
            "token": "GhUKEzE2ODI5NDI2NjAwMDAwMDAwMDA="
        },
        "resourceObjectId": "id1",
        "permissionship": "LOOKUP_PERMISSIONSHIP_HAS_PERMISSION",
        "partialCaveatInfo": null
    }
}, {
    "result": {
        "lookedUpAt": {
            "token": "GhUKEzE2ODI5NDI2NjAwMDAwMDAwMDA="
        },
        "resourceObjectId": "id2",
        "permissionship": "LOOKUP_PERMISSIONSHIP_HAS_PERMISSION",
        "partialCaveatInfo": null
    }
}]
Am I missing something?