appwrite / sdk-for-cli

[READ-ONLY] Official Appwrite CLI >_
BSD 3-Clause "New" or "Revised" License
85 stars 28 forks source link

Handling arrays returned from API #4

Closed kodumbeats closed 1 year ago

kodumbeats commented 3 years ago

When an API response returns an array, the CLI doesn't properly handle arrays. Because of this, as an example, permissions cannot be viewed via the CLI.

From the endpoint /v1/storage/files/{fileId}, the $permissions field is empty:


aspire :: ~ » appwrite storage getFile --fileId="6032c58d7ccb6"
$id : 6032c58d7ccb6
$permissions :
name : fnlist.png
dateCreated : 1613940109
signature : cea8e7c354353f26d9fbd4755005b518
mimeType : image/png
sizeOriginal : 26184

From /v1/storage/files and v1/functions, $permissions returns only the array with length in parentheses:

arrays

eldadfux commented 3 years ago

Has this been fixed on 0.6.0 @christyjacob4 @kodumbeats ?

kodumbeats commented 3 years ago

Looks like it's still an issue: arraysincli

christyjacob4 commented 3 years ago

@eldadfux @kodumbeats Since the arrays can have an indefinite amount of nesting, I had decided to display only the first level of arrays in the form of a table. Once we decide on a proper logic to handle nested arrays and how to display them, I'll go ahead with the implementation