From af8c3d7caaea8db34606915f609358fb1f7a3446 Mon Sep 17 00:00:00 2001 From: jmcudd Date: Wed, 8 Oct 2025 14:52:36 -0400 Subject: [PATCH 1/2] Update openapi.md scalar documentation `cdn` is not part of the official Scalar configuration, but it is part of the Scalar plugin and provides a means of overriding the scalar URI to the scalar bundle. --- docs/plugins/openapi.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/plugins/openapi.md b/docs/plugins/openapi.md index deff24f1..90d5c73e 100644 --- a/docs/plugins/openapi.md +++ b/docs/plugins/openapi.md @@ -166,6 +166,19 @@ Additional OpenAPI reference for each endpoint Scalar configuration, refers to [Scalar config](https://github.com/scalar/scalar/blob/main/documentation/configuration.md) +### Self-hosted Scalar bundle + +Self-host the Scalar bundle and disable CDN Fonts. + +```typescript + openapi({ + scalar: { + cdn: "/public/scalar-standalone.min.js", //Self-hosted + withDefaultFonts: false, //Disable CDN Fonts + }, + }) +``` + ## specPath @default '/${path}/json' From 625a3094e6e5900cd9e5f0d1a525a6b07bd8abee Mon Sep 17 00:00:00 2001 From: jmcudd Date: Wed, 8 Oct 2025 15:02:15 -0400 Subject: [PATCH 2/2] Update openapi.md Incorporated @coderabbitai's nitpick comments. --- docs/plugins/openapi.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/plugins/openapi.md b/docs/plugins/openapi.md index 90d5c73e..802b8b27 100644 --- a/docs/plugins/openapi.md +++ b/docs/plugins/openapi.md @@ -170,11 +170,13 @@ Scalar configuration, refers to [Scalar config](https://github.com/scalar/scalar Self-host the Scalar bundle and disable CDN Fonts. +Note: `cdn` is an Elysia OpenAPI plugin option (not part of Scalar’s own config); it overrides the URI to the Scalar bundle. + ```typescript openapi({ scalar: { - cdn: "/public/scalar-standalone.min.js", //Self-hosted - withDefaultFonts: false, //Disable CDN Fonts + cdn: "/public/scalar-standalone.min.js", // plugin override for Scalar bundle URI (self-hosted) + withDefaultFonts: false, // disable Scalar’s default font CDN }, }) ```