Skip to content

feat(serializer)!: embed blank node relations - #8939

Open
soyuka wants to merge 2 commits into
5.1from
output-resource/1-blank-node
Open

soyuka wants to merge 2 commits into
5.1from
output-resource/1-blank-node

Conversation

@soyuka

@soyuka soyuka commented Dec 3, 2026 •

Copy link
Copy Markdown
Member
Q A
Branch? 5.1 (target to be confirmed)
Tickets Refs #8849
License MIT
Doc PR api-platform/docs#2321 (to rewrite once the stack lands)

Part 1/6 of the RFC #8849 stack (https://github.com/api-platform/core/stack/8948), review commit by commit: the first commit is the failing test.

A resource with no item operation and no identifier is a blank node (/.well-known/genid/...). Used as a relation it was emitted as a genid IRI that changes on every request, so its data never reached the client. It is now always embedded: JSON-LD/JSON object without @id, HAL _embedded without self link, JSON:API inline under attributes. Writing an IRI to such a relation is a 400, its schema is a subschema. Top-level items and collection members keep their genid.

Test: tests/Functional/NotExposedTest.php (testBlankNodeRelation*, fixture FurnitureShowroom).

BC: blank node relations change shape in every format.

@soyuka
soyuka added this pull request to stack #8945 December 3, 2026 15:14
@soyuka soyuka changed the title output resource/1 blank node feat(serializer)!: embed blank node relations Dec 3, 2026
@soyuka
soyuka force-pushed the output-resource/1-blank-node branch 2 times, most recently from 7078227 to 1ed2f98 Compare December 3, 2026 19:00
A resource with no item operation and no identifier is a blank node:
it is embedded in every format (JSON-LD/JSON object without @id, HAL
_embedded without self link, JSON:API attributes), an IRI referencing it
is rejected on write and its schema is a subschema.

Refs #8849
@soyuka
soyuka force-pushed the output-resource/1-blank-node branch from 1ed2f98 to ff9594b Compare December 3, 2026 19:01
@soyuka
soyuka removed this pull request from stack #8945 December 3, 2026 19:01
@soyuka
soyuka changed the base branch from main to 5.1 December 3, 2026 19:01
@soyuka
soyuka changed the base branch from 5.1 to main December 3, 2026 19:01
@soyuka
soyuka added this pull request to stack #8947 December 3, 2026 19:01
@soyuka
soyuka removed this pull request from stack #8947 December 3, 2026 19:02
@soyuka
soyuka changed the base branch from main to 5.1 December 3, 2026 19:02
@soyuka
soyuka added this pull request to stack #8948 December 3, 2026 19:02
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