Skip to content

Support key-as-segment for navigation properties (#299)#877

Merged
27pchrisl merged 1 commit into
flat3:5.xfrom
ortic:fix/issue-299-nested-entity-delete
Jun 29, 2026
Merged

Support key-as-segment for navigation properties (#299)#877
27pchrisl merged 1 commit into
flat3:5.xfrom
ortic:fix/issue-299-nested-entity-delete

Conversation

@Remo

@Remo Remo commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Deleting or otherwise operating on a nested child entity via the key-as-segment URL form (e.g. /Flights/1/passengers/3) returned 404 because PathSegment\Key only accepted a raw EntitySet. A navigation property that resolves to a collection arrives wrapped in a PropertyValue, so the trailing key segment was never handled.

Unwrap a PropertyValue whose value is an EntitySet so a following key segment selects a single related entity, mirroring the already-working parenthesised form (/Flights(1)/passengers(3)).

Adds regression tests (Eloquent + SQL drivers) covering GET, PATCH and DELETE of a nested entity via both the parenthesised and key-as-segment URL forms.

Deleting or otherwise operating on a nested child entity via the
key-as-segment URL form (e.g. /Flights/1/passengers/3) returned 404
because PathSegment\Key only accepted a raw EntitySet. A navigation
property that resolves to a collection arrives wrapped in a
PropertyValue, so the trailing key segment was never handled.

Unwrap a PropertyValue whose value is an EntitySet so a following key
segment selects a single related entity, mirroring the already-working
parenthesised form (/Flights(1)/passengers(3)).

Adds regression tests (Eloquent + SQL drivers) covering GET, PATCH and
DELETE of a nested entity via both the parenthesised and key-as-segment
URL forms.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@27pchrisl 27pchrisl merged commit 36cd672 into flat3:5.x Jun 29, 2026
10 checks passed
@Remo Remo deleted the fix/issue-299-nested-entity-delete branch June 29, 2026 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants