Skip to content

feat(rows): read and write rows as objects on api/2 with ?shape=object - #64

Closed
rjzondervan wants to merge 2 commits into
review-base/3096from
feat/3096/row-object-shape-2
Closed

rjzondervan wants to merge 2 commits into
review-base/3096from
feat/3096/row-object-shape-2

Conversation

@rjzondervan

Copy link
Copy Markdown
Member

Internal review draft. This PR exists only to run the review skills on the fork before the upstream PR is opened. The base review-base/3096 is feat/3095/row-listing at 6055296 (the head of #63, which includes main b195670), so the diff shows only this PR's own commits. The upstream PR description will be written separately.

Refs nextcloud#3096. Depends on nextcloud#3095 (row listing, #63) and nextcloud#3093 (row uuids).

Changes

  • ?shape=object on the api/2 single-row and listing routes returns one flat object per row, keyed by the columns' technical names, with the metadata in an @self block whose id is the row uuid.
  • Datetimes carry the offset of the instance's default_timezone (new InstanceTimezone), links are {title, url, providerId}, relations are the uuid of the target row (RowSleeveMapper::findUuidsByIds).
  • Create and update accept the same object, so a row that was read can be written back unchanged. Relations are accepted by uuid, row id or label.
  • In the object shape a value that cannot be stored as given is refused with a 400 that names every invalid property (RowValidationError, errors in the response body). The cells shape and its lenient validation are unchanged.
  • New RowShape, RowObjectInput, RowObjectInputConverter, RowObjectSerializer; openapi.json and openapi.ts regenerated.

Checks run locally

  • On this head: phpunit 739/739, psalm, cs and rector clean, openapi.json and openapi.ts regenerate without a diff.
  • Moved onto the signed Rows listing endpoint on api/2 with filter, sort, search and paging nextcloud/tables#3095 head on 2026-11-18 (cherry-pick of the original commit): conflicts only in docblocks and test imports; findUuidsByIds uses fetchAssociative() per main's rector rule; the object-shape test passes the RowVisibilityService that RowService now takes.
  • Added database tests for findUuidsByIds (duplicates, rows without a uuid, more than one chunk) and a unit test for InstanceTimezone.

🤖 Generated with Claude Code

rjzondervan and others added 2 commits November 18, 2026 13:28
The single-row and listing routes return, with shape=object, one flat object per
row keyed by the technical names of the columns, with the metadata in an @self
block whose id is the row uuid. Datetimes carry the offset of the instance's
default_timezone, links are {title, url, providerId} and relations are the uuid
of the target row.

Create and update accept the same object, so a row that was read can be written
back unchanged. Relations are accepted by uuid, row id or label. A value that
cannot be stored as given is no longer stored as empty: the request is refused
with a 400 that names every invalid property. The cells shape and its lenient
validation are unchanged.

Closes nextcloud#3096

Assisted-by: ClaudeCode:claude-opus-5-5
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Robert Zondervan <robert@conduction.nl>
findUuidsByIds was only tested through a mock: test it against the
database for duplicate ids, rows without a uuid and an id list that
spans more than one chunk. Test that InstanceTimezone reads
default_timezone once and falls back to UTC for an unknown zone.

Refs nextcloud#3096
Assisted-by: ClaudeCode:claude-opus-5-5

Signed-off-by: Robert Zondervan <robert@conduction.nl>
@rjzondervan

Copy link
Copy Markdown
Member Author

Split into #65 (read rows as objects) and #66 (write rows as objects) to keep each review to one side of the object shape. Together they are byte-identical to this PR's tree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant