Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add ability to configure UI through configuration #2251

Merged
merged 12 commits into from
Apr 19, 2024

Conversation

HypeMC
Copy link
Contributor

@HypeMC HypeMC commented Apr 1, 2024

Q A
Bug fix? no
New feature? yes
Deprecations? no
Issues -

Adds the ability to configure the UI through configuration:

nelmio_api_doc:
  html_config:
    assets_mode: bundle
    redocly_config:
      expandResponses: '200,201'
      hideDownloadButton: true
    swagger_ui_config:
      deepLinking: true

@HypeMC HypeMC force-pushed the configure-redocly branch 2 times, most recently from 626522c to f5c5e99 Compare April 8, 2024 00:05
Copy link
Collaborator

@DjordyKoert DjordyKoert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This configuration option should more generic to potentially allow more options in the future, this also aligns this new configuration option with the DumpCommand --html-config option and also let's it serve as a potential way to customize the default value for --html-config.

src/DependencyInjection/Configuration.php Outdated Show resolved Hide resolved
src/Render/Html/HtmlOpenApiRenderer.php Outdated Show resolved Hide resolved
src/Render/Html/HtmlOpenApiRenderer.php Outdated Show resolved Hide resolved
src/Render/Html/HtmlOpenApiRenderer.php Outdated Show resolved Hide resolved
src/Render/Html/HtmlOpenApiRenderer.php Outdated Show resolved Hide resolved
src/DependencyInjection/Configuration.php Outdated Show resolved Hide resolved
src/Render/Html/HtmlOpenApiRenderer.php Outdated Show resolved Hide resolved
tests/DependencyInjection/NelmioApiDocExtensionTest.php Outdated Show resolved Hide resolved
@HypeMC HypeMC force-pushed the configure-redocly branch 2 times, most recently from ea83245 to c369078 Compare April 8, 2024 19:56
@HypeMC
Copy link
Contributor Author

HypeMC commented Apr 18, 2024

I've rebased the PR since there were conflicts.

@DjordyKoert
Copy link
Collaborator

I've rebased the PR since there were conflicts.

Thank you! I was planning on doing it myself but I was not able to find the time for it yet :) I will try and have a look at everything later today if my time allows it

@DjordyKoert DjordyKoert changed the title Add ability to configure UI through configuration feat: Add ability to configure UI through configuration Apr 19, 2024
@DjordyKoert DjordyKoert merged commit 5669b8f into nelmio:master Apr 19, 2024
12 checks passed
@DjordyKoert
Copy link
Collaborator

Thank you @HypeMC :)

@HypeMC HypeMC deleted the configure-redocly branch April 19, 2024 14:09
DjordyKoert pushed a commit that referenced this pull request May 29, 2024
| Q | A |

|---------------|---------------------------------------------------------------------------------------------------------------------------|
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | -

Currently the `SwaggerUiController` doesn't respect the `assets_mode`
configuration added in #2251.

```yaml
nelmio_api_doc:
  html_config:
    assets_mode: cdn
```

As far as I can tell, there's no reason for the default any more as it
can be set through the configuration and overridden in the `DumpCommand`
command using the `html-config` option.
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.

2 participants