Repository navigation
feat(rows): read and write rows as objects on api/2 with ?shape=object - #64
Closed
rjzondervan wants to merge 2 commits into
Closed
rjzondervan wants to merge 2 commits into
rjzondervan wants to merge 2 commits into
Conversation
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>
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/3096isfeat/3095/row-listingat 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=objecton 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@selfblock whoseidis the row uuid.default_timezone(newInstanceTimezone), links are{title, url, providerId}, relations are the uuid of the target row (RowSleeveMapper::findUuidsByIds).RowValidationError,errorsin the response body). The cells shape and its lenient validation are unchanged.RowShape,RowObjectInput,RowObjectInputConverter,RowObjectSerializer; openapi.json and openapi.ts regenerated.Checks run locally
findUuidsByIdsusesfetchAssociative()per main's rector rule; the object-shape test passes theRowVisibilityServicethatRowServicenow takes.findUuidsByIds(duplicates, rows without a uuid, more than one chunk) and a unit test forInstanceTimezone.🤖 Generated with Claude Code