Skip to content

feat!: remove deprecated APIs scheduled for 5.0#8367

Merged
soyuka merged 11 commits into
api-platform:mainfrom
soyuka:feat/remove-deprecated-5.0-a
Jul 1, 2026
Merged

feat!: remove deprecated APIs scheduled for 5.0#8367
soyuka merged 11 commits into
api-platform:mainfrom
soyuka:feat/remove-deprecated-5.0-a

Conversation

@soyuka

@soyuka soyuka commented Jun 30, 2026

Copy link
Copy Markdown
Member

Removes deprecated code paths kept as BC layers until 5.0 (TODO bucket A). LegacyType PropertyInfo removals ship separately (#8364); FilterInterface::getDescription() and the OpenApi swagger field stay deferred to 6.0.

Removals

  • SerializerAwareProviderInterface / SerializerAwareProviderTrait + the DataProviderPass compiler pass (deprecated 4.2).
  • ObjectMapperProcessor (deprecated 4.3) — use ObjectMapperInputProcessor / ObjectMapperOutputProcessor.
  • DefinitionNameFactory: drop the $distinctFormats constructor argument (and from JsonSchema\SchemaFactory + wiring).
  • ValidationException: first constructor argument is now ConstraintViolationListInterface (string messages no longer accepted).
  • DeserializeProvider: ASSIGN_OBJECT_TO_POPULATE must be set explicitly (set upstream by MainController / DeserializeListener); drop the implicit per-method fallback.
  • ApiTestCase::$alwaysBootKernel now defaults to false (see bug(tests): (Symfony)ApiTestCase::createClient() boot kernel on each call #6971).
  • Configuration: removed deprecated nodes query_parameter_validation, enable_link_security, resource_class_directories, graphql_playground, varnish_urls, xkey.
  • Resource short name deduplication is now automatic; dropped the opt-in extra_properties.deduplicate_resource_short_names flag.

Notes

  • 26 files, mostly deletions.
  • Verified locally: php-cs-fixer clean; ConfigurationTest, ValidationExceptionTest, AttributesResourceMetadataCollectionFactoryTest, DefinitionNameFactoryTest, JsonSchema SchemaFactoryTest, ApiPlatformBundleTest all green. Functional tests + phpstan rely on CI (local kernel boot blocked by an unrelated env issue).
Q A
Branch? main
BC breaks? yes (5.0)
Tickets -
License MIT
Doc PR -

soyuka added 7 commits July 1, 2026 07:52
Drop deprecated code paths kept as BC layers until 5.0 (TODO bucket A).
LegacyType PropertyInfo removals are handled separately; the getDescription()
and OpenApi swagger field removals stay deferred to 6.0.

- Remove SerializerAwareProviderInterface / SerializerAwareProviderTrait and
  the DataProviderPass compiler pass (deprecated 4.2).
- Remove ObjectMapperProcessor (deprecated 4.3); use ObjectMapperInputProcessor
  and ObjectMapperOutputProcessor.
- DefinitionNameFactory: drop the $distinctFormats constructor argument;
  drop it from JsonSchema\SchemaFactory and its wiring.
- ValidationException: the first constructor argument is now a
  ConstraintViolationListInterface (string messages no longer accepted).
- DeserializeProvider: ASSIGN_OBJECT_TO_POPULATE must be set explicitly
  (it is set upstream by MainController / DeserializeListener); drop the
  implicit per-method fallback.
- ApiTestCase::$alwaysBootKernel now defaults to false.
- Configuration: remove deprecated nodes query_parameter_validation,
  enable_link_security, resource_class_directories, graphql_playground,
  varnish_urls and xkey.
- Resource short name deduplication is now automatic; drop the opt-in
  extra_properties.deduplicate_resource_short_names flag.
enable_link_security was removed from Configuration in the 5.0 cleanup,
but config_common.yml still set it, so cache:warmup failed with
"Unrecognized option" and broke every job booting the test container.
DeserializeProvider no longer triggers the object_to_populate deprecation
in 5.0; the assertions for it are dead and the test now fails.
DeserializeProvider only populates the loaded object when
api_assign_object_to_populate is set in the denormalization context. The
Symfony path sets it in MainController/DeserializeListener, but the
Laravel controller did not, so PATCH re-inserted a fresh model and hit
NOT NULL constraint violations. Mirror the Symfony logic: set it for
POST, PATCH and non-standard PUT.
The SerializableProvider class was removed with the 5.0 deprecation
cleanup; config_common.yml still registered it as a service, failing
lint:container with "class does not exist".
The code paths fetching private services were removed in the 5.0 cleanup,
leaving the ignore pattern unmatched and failing PHPStan with
reportUnmatchedIgnoredErrors.
With automatic short name deduplication, the operation serving a request
carries the deduplicated short name (e.g. AttributeResource2), so @context
follows it while @type used the first resource's short name, producing a
mismatch. Use the operation short name for @type when the operation serves
the normalized class; keep the resource-level lookup for embedded resources
whose operation belongs to another class.
@soyuka soyuka force-pushed the feat/remove-deprecated-5.0-a branch from 56407b7 to f806ae6 Compare July 1, 2026 05:55
soyuka added 4 commits July 1, 2026 08:14
Resources sharing a short name now get a deduplicated suffix (e.g.
AttributeResource2, Employee3), so @context and @type carry the
deduplicated name. Update the functional expectations accordingly.
The getLastPage/getTotalItems float return errors no longer fire, so the
inline ignores were reported as unmatched.
testGetEmbeddedRelationAtThirdLevel @type and testOneToOneFromOwningSide
(@context/@type Dummy3) were missed/mis-suffixed in the previous pass.
…name

Company shares its short name across three ODM #[ApiResource] blocks vs
two on ORM, so automatic dedup yielded Company3 on ODM but Company2 on ORM
for /employees/{employeeId}/company. Naming the ODM-only /rooms block keeps
that endpoint at Company2 on both configs.
@soyuka soyuka merged commit e22e744 into api-platform:main Jul 1, 2026
91 of 97 checks passed
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