Repository navigation
feat(jsonld): operations as schema.org actions - #8877
Merged
Merged
Conversation
soyuka
marked this pull request as ready for review
November 27, 2026 15:57
Operations flagged with extraProperties: ['potential_action' => true] are listed under potentialAction in the JSON-LD representation of the GET item (operations with URI variables) or collection (operations without) they belong to. An @type discriminated input yields one action per mapping key; other operations use their hydra @type or a default derived from the HTTP method. Required input properties are annotated with <property>-input. The resource context scopes potentialAction to the schema.org vocabulary.
Replace the potential_action extra property with a first-class potentialAction option (bool|string|array) and stop reading the action type from hydraContext. Nest -input annotations under result/object when the input is the resource, skip them for PATCH/DELETE, evaluate operation security, support subresource collections and forward reset() to the decorated normalizer.
soyuka
force-pushed
the
feat/jsonld-potential-action
branch
from
November 27, 2026 16:26
f5ccbe2 to
9a4c3b4
Compare
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.
Adds schema.org potential actions. Operations flagged with
extraProperties: ['potential_action' => true]are listed underpotentialActionin the JSON-LD representation of their resource: on the item when the operation has URI variables, on the collection otherwise.#[Post( uriTemplate: '/actionable_books/{id}/archive', input: ArchiveBookInput::class, hydraContext: ['@type' => 'schema:ArchiveAction'], extraProperties: ['potential_action' => true], )]Each action carries an
EntryPoint(urlTemplate,httpMethod,encodingType,contentType) and a<property>-input: requiredannotation per required writable property. The action type comes from, in order: one action per mapping key for a@typediscriminated input, the operation's hydra@type, or a default derived from the HTTP method (CreateAction,ReplaceAction,UpdateAction,DeleteAction). The resource context scopespotentialActionto the schema.org vocabulary.Test:
tests/Functional/JsonLd/PotentialActionTest.php