elysiajs / elysia-swagger

A plugin for Elysia to auto-generate Swagger page
MIT License
74 stars 36 forks source link

Scalar options aren't applied #94

Closed Mudbill closed 5 months ago

Mudbill commented 5 months ago

The scalarConfig object is ignored for the most part, instead of actually applying to the Scalar UI. As a result, almost all these options have no effect if you try to set them:

image

I checked the source code and found that only the customCss and spec.url options are applied.

Is this an oversight, or deliberate?

If I understand the docs correctly, it could be fixed with this:

<script
    id="api-reference"
    data-url="${config.spec?.url}"
    data-configuration="${JSON.stringify(config)}"
></script>

Using:

marclave commented 5 months ago

@Mudbill implemented in https://github.com/elysiajs/elysia-swagger/pull/96