Skip to content

Conversation

@Umpire2018
Copy link

@Umpire2018 Umpire2018 commented Oct 10, 2025

Description

This PR added a example that demonstrates how to customize Scalar render options using the options parameter in ScalarRenderPlugin.

Besides, here is an alternative provided by copilot. I found that there is enhancement after reviewing this PR and then came up with another solution.

Closes #4381 , thanks to @JacobCoffee BTW.

- Refactor `docs/usage/openapi/ui_plugins.rst` to merge and clarify configuration and customization, avoiding duplication.
@Umpire2018 Umpire2018 requested review from a team as code owners October 10, 2025 07:21
@github-actions github-actions bot added area/docs This PR involves changes to the documentation size: small type/feat pr/external Triage Required 🏥 This requires triage labels Oct 10, 2025
@github-actions
Copy link

Documentation preview will be available shortly at https://litestar-org.github.io/litestar-docs-preview/4416

.. literalinclude:: /examples/openapi/plugins/swagger_ui_oauth.py
:language: python

Customizing the OpenAPI UI
Copy link
Member

Choose a reason for hiding this comment

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

should we have removed this section? it needs to be updated to not be so specific to scalar but i think OpenAPI UI can be customized by overriding the default ``css_url`` and ``js_url`` attributes is generic across all our renderers? can probably leave it alone and have another pr to update

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

should we have removed this section?

  1. I prefer to remove this section because i found that we already explained css_url and js_url in https://docs.litestar.dev/main/usage/openapi/ui_plugins.html#configuring-openapi-ui-plugins.

it needs to be updated to not be so specific to scalar

  1. I agree with you. As far as at the https://docs.litestar.dev/main/usage/openapi/ui_plugins.html#customizing-the-openapi-ui part , it would be better to provide different showcases.

css_url and js_url attributes is generic across all our renderers?

  1. Negative. RapidDoc and Redoc don't supprt css_url base on API Reference so far. But maybe it's time to leave some #TODO in code to make it generic.

#cdn-and-offline-file-support part is duplicate.

  1. Maybe we can combine it into #configuring-openapi-ui-plugins part?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/docs This PR involves changes to the documentation pr/external size: small Triage Required 🏥 This requires triage type/feat

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create example for customizing Scalar render options

2 participants