Skip to content

fix(laravel): inject missing dependencies into HydraSchemaFactory#7960

Open
gd6tm wants to merge 1 commit intoapi-platform:mainfrom
gd6tm:main
Open

fix(laravel): inject missing dependencies into HydraSchemaFactory#7960
gd6tm wants to merge 1 commit intoapi-platform:mainfrom
gd6tm:main

Conversation

@gd6tm
Copy link
Copy Markdown
Contributor

@gd6tm gd6tm commented May 7, 2026

Summary

  • HydraSchemaFactory was registered in ApiPlatformProvider without ResourceMetadataCollectionFactoryInterface and DefinitionNameFactoryInterface
  • As a result, isResourceClass() always returned false, and Hydra base schemas (HydraItemBaseSchema, HydraCollectionBaseSchema) were never included in the OpenAPI output
  • This PR injects the two missing dependencies when binding HydraSchemaFactory in the service container

Context

This is a follow-up fix to #7924, which corrected isResourceClass() returning true for all classes by changing the fallback to false. That change exposed this registration bug in the Laravel provider: since the dependencies
were never injected, the factory always fell back to false regardless.

Test plan

  • Verify that Hydra base schemas appear in the OpenAPI output for API Platform resources
  • Verify that non-resource classes are still correctly excluded

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