Skip to content

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

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

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

Conversation

@soyuka

@soyuka soyuka commented Dec 3, 2026 •

Copy link
Copy Markdown
Member
Q A
Branch? main (6.0, merge after v5.1.0)
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/8945), 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.

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 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
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