cytoscape / cyREST

Core App: REST API module for Cytoscape
https://github.com/cytoscape/cyREST/wiki
MIT License
30 stars 13 forks source link

How to set collection names #108

Open AlexanderPico opened 3 years ago

AlexanderPico commented 3 years ago

I attempted to useput /v1/collections/{networkId}/tables/{tableType}, but it did not work. Taking a look at the default table of the root for the Yeast Perturbation sample network, I see that "name" is immutable (screenshot).

Should "name" be immutable? You can rename collections in the GUI.

Should we add rename functions to CyREST for collections?

Related RCy3 request: https://github.com/cytoscape/RCy3/issues/107

AlexanderPico commented 3 years ago

Any updates on this issue?

dotasek commented 3 years ago

How did you perform the PUT?

I got mine to rename the collection (the SUID of the root network was 83 in this case):

PUT 'http://localhost:1234/v1/collections/83/tables/default'

body: { "key": "SUID", "data": [{ "SUID":83, "name": "newname"}] }

Would this satisfy the need for renaming functionality?

The immutable property is of the column, not of row data. You can't delete 'name' columns.

I did find the example JSON and other Swagger documentation on the PUT endpoint confusing, and I wrote it in the first place. It very much needs improvement.