Skip to content

Configurable asset package#3764

Merged
soyuka merged 1 commit into
api-platform:masterfrom
smatyas:asset-package
Nov 8, 2020
Merged

Configurable asset package#3764
soyuka merged 1 commit into
api-platform:masterfrom
smatyas:asset-package

Conversation

@smatyas

@smatyas smatyas commented Oct 15, 2020

Copy link
Copy Markdown
Contributor
Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tickets fixes #3760
License MIT
Doc PR api-platform/docs#1186

This PR introduces a new config parameter: asset_package

It enables the users to specify a custom asset package (as in Symfony framework) to be used by the Swagger UI template.
In this way, we have more fine-grained control over the asset url generations.

The new parameter is optional with a null default value. It results in the same asset(...) twig function calls as it was before.


Example usage of the new parameter:

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

and the corresponding symfony framework setup example:

# config/packages/framework.yaml
framework:
    # ...
    assets:
        base_path: '/custom_base_path' # the default
        packages:
            api_platform:
                base_path: '/'

Fix unit tests

cs fix

minor fixes
@smatyas

smatyas commented Oct 19, 2020

Copy link
Copy Markdown
Contributor Author

The cs-fixer test seems to be invalid, the diff does not contain the failing change anymore.

@soyuka soyuka merged commit 4eda8d5 into api-platform:master Nov 8, 2020
@soyuka

soyuka commented Nov 8, 2020

Copy link
Copy Markdown
Member

thanks @smatyas !

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.

[Bridge/Symfony/Bundle] configurable asset package

2 participants