feat(symfony): deprecate jsonapi.use_iri_as_id defaulting to true#8327
Open
soyuka wants to merge 4 commits into
Open
feat(symfony): deprecate jsonapi.use_iri_as_id defaulting to true#8327soyuka wants to merge 4 commits into
soyuka wants to merge 4 commits into
Conversation
Allows defining JSON-LD namespace prefix entries (e.g. `dct: http://purl.org/dc/terms/`) directly on ApiResource/HttpOperation, which get merged into the generated `@context` output. Closes api-platform#767
The "api_platform.jsonapi.use_iri_as_id" option now defaults to null so the extension can tell an unset value from an explicit one. When unset, a 4.4 deprecation is triggered and the value is coerced to true, preserving current behavior. The default will change to false in 5.0. Set the option explicitly to true or false to silence the deprecation.
…0d2ea776066d1 # Conflicts: # src/Symfony/Bundle/DependencyInjection/ApiPlatformExtension.php
Config processing now returns null (default_null); the true coercion happens in the extension. Companion to the deprecation in this PR.
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.
What
Deprecate relying on the implicit
truedefault ofapi_platform.jsonapi.use_iri_as_id(4.4). The default will flip tofalsein 5.0.How
Configuration:use_iri_as_idnodedefaultTrue()→defaultNull(), so the extension can distinguish unset from an explicittrue/false. Removed the// TODO 4.4marker;info()text notes the upcoming 5.0 default change.ApiPlatformExtension::registerJsonApiConfiguration(): when the resolved value isnull(unset), emit a 4.4trigger_deprecationand coerce totrue— runtime behavior is unchanged. Explicittrue/falsepass through with no deprecation.api-platform/json-apitosrc/Symfonyrequire-devso the gated jsonapi extension path is reachable in the standalone component suite.Deprecation message
BC
Zero BC break — additive deprecation only. Implicit
trueis preserved at runtime.Tests
New
JsonApiUseIriAsIdDeprecationTest(component suite,#[Group('legacy')]+#[IgnoreDeprecations]): unset → deprecation fires + resolvestrue; explicitfalse→ no deprecation + resolvesfalse; explicittrue→ no deprecation + resolvestrue. Green under--fail-on-deprecation.