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

Enhancement: ExternalDocumentation for ScalarRenderPlugin #3583

Open
cringelord000222 opened this issue Jun 19, 2024 · 2 comments
Open

Enhancement: ExternalDocumentation for ScalarRenderPlugin #3583

cringelord000222 opened this issue Jun 19, 2024 · 2 comments
Labels
Enhancement This is a new feature or request Triage Required 🏥

Comments

@cringelord000222
Copy link

cringelord000222 commented Jun 19, 2024

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.
Fund with Polar
@cringelord000222 cringelord000222 added the Enhancement This is a new feature or request label Jun 19, 2024
@JacobCoffee
Copy link
Member

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)

@cringelord000222
Copy link
Author

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"
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement This is a new feature or request Triage Required 🏥
Projects
None yet
Development

No branches or pull requests

2 participants