Enhancement: ExternalDocumentation for ScalarRenderPlugin
Opened this issue · 2 comments
Summary
Hi there,
From what I've tried (v2.9.0
), ExternalDocumentation only works on redoc
and swagger
, among the few litestar examples given in OpenAPI UI Plugins.
Would love to have it on Scalar
as well (ScalarRenderPlugin), since I read that it's going to be the default plugin for v3.0.0
.
Not sure if this is the correct place to ask, but thanks in advance.
Basic Example
FYI, this is the rough code that I used:
from litestar.app import Litestar
from litestar.openapi import OpenAPIConfig
from litestar.openapi.plugins ScalarRenderPlugin,
from litestar.openapi.spec import ExternalDocumentation
Litestar(
openapi_config=OpenAPIConfig(
title="title",
version="version",
external_docs=ExternalDocumentation(
url=project_metadata["project"]["urls"]["Repository"],
description="Repository",
),
render_plugins=[
ScalarRenderPlugin(),
],
path="/docs",
)
)
Drawbacks and Impact
None
Unresolved questions
None
Note
While we are open for sponsoring on GitHub Sponsors and
OpenCollective, we also utilize Polar.sh to engage in pledge-based sponsorship.
Check out all issues funded or available for funding on our Polar.sh dashboard
- If you would like to see an issue prioritized, make a pledge towards it!
- We receive the pledge once the issue is completed & verified
- This, along with engagement in the community, helps us know which features are a priority to our users.
If this isnt working it may be a bug. I think Scalar supports ExternalDocumentation (https://github.com/search?q=repo%3Ascalar%2Fscalar%20ExternalDocumentation&type=code)
If this isnt working it may be a bug. I think Scalar supports ExternalDocumentation (https://github.com/search?q=repo%3Ascalar%2Fscalar%20ExternalDocumentation&type=code)
I've downloaded the spec.json
and the externalDocs
section does exist. It's just that this part is not rendering in the frontend.
# within spec.json
"externalDocs": {
"url": "https://github.com/litestar-org/litestar",
"description": "Repository"
}