diff --git a/bun.lockb b/bun.lockb index a5473bc..147a7ee 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index fdd5a4b..eb62827 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ }, "devDependencies": { "@apidevtools/swagger-parser": "^10.1.0", - "@scalar/api-reference": "^1.12.5", + "@scalar/api-reference": "^1.25.21", "@types/bun": "1.1.6", "@types/lodash.clonedeep": "^4.5.9", "elysia": ">= 1.1.0-rc.2", diff --git a/src/index.ts b/src/index.ts index bfbd905..e1dcf1c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,7 +7,7 @@ import { ScalarRender } from './scalar' import { filterPaths, registerSchemaPath } from './utils' import type { OpenAPIV3 } from 'openapi-types' -import type { ReferenceConfiguration } from './scalar/types' +import type { ReferenceConfiguration } from '@scalar/api-reference' import type { ElysiaSwaggerConfig } from './types' /** @@ -97,7 +97,7 @@ export const swagger = async ( stringifiedSwaggerOptions, autoDarkMode ) - : ScalarRender(scalarVersion, scalarConfiguration, scalarCDN), + : ScalarRender(info, scalarVersion, scalarConfiguration, scalarCDN), { headers: { 'content-type': 'text/html; charset=utf8' diff --git a/src/scalar/index.ts b/src/scalar/index.ts index c9e02d0..fbe8558 100644 --- a/src/scalar/index.ts +++ b/src/scalar/index.ts @@ -1,14 +1,24 @@ import scalarElysiaTheme from './theme' -import type { ReferenceConfiguration } from './types' +import type { OpenAPIV3 } from 'openapi-types' +import type { ReferenceConfiguration } from '@scalar/api-reference' export const ScalarRender = ( + info: OpenAPIV3.InfoObject, version: string, config: ReferenceConfiguration, cdn: string ) => ` - API Reference + ${info.title} + + void; -}; - export type SpecConfiguration = { /** URL to a Swagger/OpenAPI file */ url?: string; diff --git a/src/types.ts b/src/types.ts index 1c41e04..7f21ecd 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,5 +1,5 @@ import type { OpenAPIV3 } from 'openapi-types' -import type { ReferenceConfiguration } from './scalar/types' +import type { ReferenceConfiguration } from '@scalar/api-reference' import type { SwaggerUIOptions } from './swagger/types' export interface ElysiaSwaggerConfig {