Skip to content

[Bridge/Symfony/Bundle] configurable asset package #3760

Description

@smatyas

Description
Using the Symfony framework, it would be useful in some cases if we could configure the "asset package" used by the api platform.
In this way, we would have more control over the generated asset urls: https://symfony.com/doc/4.4/reference/configuration/framework.html#packages

Example
There could be a new config option with the currently used null default value, so it would be backward-compatible.

# app/config/packages/api_platform.yaml
api_platform:
    asset_package: 'custom_package'

The current templates should need only some minor modifications i.e.:

- <link rel="stylesheet" href="{{ asset('bundles/apiplatform/style.css') }}">
+ <link rel="stylesheet" href="{{ asset('bundles/apiplatform/style.css', asset_package) }}">

And of course that new parameter has to be set for the templates i.e. in \ApiPlatform\Core\Bridge\Symfony\Bundle\Action\SwaggerUiAction::getContext

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions