/rows/simple api endpoint doesn't return proper values + comment on /rows
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 214
- Forks
- 52
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 82
Description
Steps to reproduce
- create a table with columns of type link/url and selection.
- add a row
- query the api
Expected behavior
/rows/simple should return:
[['link', 'select'], ['http://example.com', 'choice 1']]
The same should be true for all column types.
Actual behavior
It returns:
[['link', 'select'], ['{"title":"http://example.com","subline":"URL","providerId":"url","value":"http://example.com"}', [0]]]
The link is a json string that I could parse if I was expecting it and the [0] is completely useless.
Tables app version
0.6.0
Browser
No response
Client operating system
No response
Operating system
No response
Web server
None
PHP engine version
None
Database
None
Additional info
The normal /rows endpoint is IMHO also not ideal. Depending on the column type the value is formatted in completely different ways. It can be a string, a json string or a list of integers that point to a list entry somewhere else. According to the the API documentation it should always be a string. This is probably a difficult problem to solve but I think it would be good if you could find a more consistent/uniform way of presenting that data.
I'm currently not really sure what type of values this API is supposed to return. Should it be a simple string for the link or json? And should the the value of a selection column be a list of indexes or the actual values, possibly as csv if there are more than one?
And the fact that the formatting differs based on the version of tables that was used to enter the data doesn't make any of this easier.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue against the /rows/simple and /rows endpoints using link/url and selection columns, then compare both responses with the API documentation. The work is complete when the expected value representation is decided and applied consistently across column types, including data created with older Tables versions.
Written by the indexing model from the issue text.
Assessment
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100