Skip to content

fix: add symfony/asset as a required dependency for Swagger UI - #8506

Open
Maxcastel wants to merge 1 commit into
api-platform:4.3from
Maxcastel:fix/require-symfony-asset
Open

fix: add symfony/asset as a required dependency for Swagger UI#8506
Maxcastel wants to merge 1 commit into
api-platform:4.3from
Maxcastel:fix/require-symfony-asset

Conversation

@Maxcastel

Copy link
Copy Markdown
Contributor
Q A
Branch? 4.3
Tickets N/A
License MIT
Doc PR N/A

Summary

GET /api/docs returns a 500 on a project where API Platform was installed with composer require api-platform/core:

Did you forget to run "composer require symfony/asset"?
Unknown function "asset" in "@ApiPlatform/SwaggerUi/index.html.twig".

The Swagger UI integration uses Twig's asset() function, which requires the symfony/asset package to be installed. However, symfony/asset was only listed as a dev dependency, causing a 500 error when accessing the documentation endpoint in projects that don't have this package installed.

Capture d’écran du 2026-09-08 10-06-48

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