Skip to content

feat: add support for Scalar UI#2711

Merged
DjordyKoert merged 3 commits into
nelmio:5.xfrom
maks-oleksyuk:feat/scalar-theme
Apr 10, 2026
Merged

feat: add support for Scalar UI#2711
DjordyKoert merged 3 commits into
nelmio:5.xfrom
maks-oleksyuk:feat/scalar-theme

Conversation

@maks-oleksyuk
Copy link
Copy Markdown
Contributor

Description

Adds support for https://scalar.com as an alternative API documentation UI renderer, alongside the existing SwaggerUI, Redocly, and Stoplight Elements options.

What's included:

  • New scalar renderer constant in Renderer.php
  • scalar_config configuration node to pass https://scalar.com/products/api-references/configuration
  • Dedicated Twig template (templates/Scalar/index.html.twig) with bundled standalone JS
  • New routing file (config/routing/scalar.php) for serving the Scalar UI
  • Service definition for the Scalar controller
  • Documentation update in docs/configuration_reference.rst

Closes #...

What type of PR is this? (check all applicable)

  • Bug Fix
  • Feature
  • Refactor
  • Deprecation
  • Breaking Change
  • Documentation Update
  • CI

Checklist

  • I have made corresponding changes to the documentation (docs/)

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.60%. Comparing base (e6a9666) to head (92955ac).
⚠️ Report is 3 commits behind head on 5.x.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##              5.x    #2711      +/-   ##
==========================================
+ Coverage   95.59%   95.60%   +0.01%     
==========================================
  Files          94       94              
  Lines        3064     3075      +11     
==========================================
+ Hits         2929     2940      +11     
  Misses        135      135              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@HecFranco
Copy link
Copy Markdown
Contributor

I’d like to give this PR some visibility because I think it adds real value to the bundle.

Supporting Scalar as an additional API documentation renderer feels like a very useful improvement: it expands the available UI options without replacing the existing ones, includes documentation updates, and the checks/coverage look good from what is shown in the PR. This could make NelmioApiDocBundle more flexible for teams that want a more modern API reference experience. ([GitHub]1)

Even though this is not my PR, I believe it would be great to review and approve it if it aligns with the project direction. It seems like a valuable feature addition for the community. ([GitHub]1)

@DjordyKoert DjordyKoert merged commit 3c80aa6 into nelmio:5.x Apr 10, 2026
37 of 38 checks passed
@DjordyKoert
Copy link
Copy Markdown
Collaborator

Sorry for the late reply!

This looks great, thank you very much! ❤️

DjordyKoert added a commit that referenced this pull request Apr 10, 2026
## Description

dependabot was not updating the files for stoplight automatically, this
got fixed in #2711

I ran all UI commands locally

## What type of PR is this? (check all applicable)
- [ ] Bug Fix
- [ ] Feature
- [ ] Refactor
- [ ] Deprecation
- [ ] Breaking Change
- [ ] Documentation Update
- [ ] CI

## Checklist
- [ ] I have made corresponding changes to the documentation (`docs/`)
DjordyKoert pushed a commit that referenced this pull request Apr 10, 2026
🤖 I have created a release *beep* *boop*
---


##
[5.10.0](v5.9.5...v5.10.0)
(2026-04-10)


### Features

* add support for Scalar UI
([#2711](#2711))
([3c80aa6](3c80aa6))


### Bug Fixes

* exclude BackedEnum from TranslatablePropertyDescriber
([#2692](#2692))
([2c40b2e](2c40b2e)),
closes [#2507](#2507)
* **phpstan:** apply phpstan fixes
([#2721](#2721))
([3cbe708](3cbe708))
* prevent nullable from triggering oneOf wrapping in JMSModelDescriber
([#2693](#2693))
([7167809](7167809)),
closes [#2565](#2565)
* use FQCN as deduplication key to prevent model merge across namespaces
([#2694](#2694))
([25e8b98](25e8b98))


### Miscellaneous Chores

* **deps:** bump swagger-ui-dist from 5.32.0 to 5.32.1 in /utils
([#2712](#2712))
([b5d5e1f](b5d5e1f))
* support zircote/swagger-php ^6.0
([#2717](#2717))
([3add4a7](3add4a7))
* **ui:** update scalar & stoplight files
([#2719](#2719))
([94d113b](94d113b))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

3 participants