File tree Expand file tree Collapse file tree 2 files changed +16
-12
lines changed
src/main/resources/templates Expand file tree Collapse file tree 2 files changed +16
-12
lines changed Original file line number Diff line number Diff line change @@ -76,8 +76,8 @@ SWAGGER_REDOC_ENABLED=<TRUE/FALSE> # Enable or disable ReDoc UI
7676SWAGGER_REDOC_PATH = <REDOC_PATH> # Path to access ReDoc UI (e.g., /redoc)
7777
7878# Settings for your Scalar UI
79- SCALAR_ENABLED = <TRUE/FALSE> # Enable or disable ReDoc UI
80- SCALAR_PATH = <SCALAR_PATH> # Path to access ReDoc UI (e.g., /redoc )
79+ SCALAR_ENABLED = <TRUE/FALSE> # Enable or disable Scalar UI
80+ SCALAR_PATH = <SCALAR_PATH> # Path to access Scalar UI (e.g., /scalar )
8181
8282# Settings for your Swagger UI
8383SWAGGER_UI_ENABLED = <TRUE/FALSE> # Enable or disable Swagger UI
Original file line number Diff line number Diff line change 33< head >
44 < meta charset ="UTF-8 "/>
55 < meta content ="width=device-width, initial-scale=1.0 " name ="viewport "/>
6- < title th:text ="${title} ?: 'API Documentation (Scalar)' "> API Docs</ title >
7-
8- <!-- Scalar API Reference -->
9- < script id ="scalar-script "
10- src ="https://cdn.jsdelivr.net/npm/@scalar/api-reference@latest/dist/browser/standalone.min.js "> </ script >
6+ < title th:text ="${title} "> API Docs</ title >
117
128 < style >
139 body {
4137</ head >
4238< body >
4339< div id ="api-reference "> </ div >
44- < script th:inline ="javascript ">
45- const specUrl = [ [ $ { specUrl} ] ] ;
46- document . addEventListener ( "DOMContentLoaded" , function ( ) {
40+ < script th:inline ="javascript " type ="module ">
41+ /*<![CDATA[*/
42+ import {
43+ ScalarApiReference
44+ } from 'https://cdn.jsdelivr.net/npm/@scalar/api-reference@1.38.1/dist/browser/standalone.module.js' ;
45+
46+ const specUrl = [ [ $ { specUrl} ] ] || '/v3/api-docs' ;
47+ const theme = window . matchMedia ( '(prefers-color-scheme: dark)' ) . matches ? 'dark' : 'light' ;
48+
49+ document . addEventListener ( "DOMContentLoaded" , ( ) => {
4750 ScalarApiReference ( {
4851 element : "#api-reference" ,
49- spec : { url : specUrl || "/v3/api-docs" } ,
50- theme : window . matchMedia ( '(prefers-color-scheme: dark)' ) . matches ? 'dark' : 'light' ,
52+ spec : { url : specUrl } ,
53+ theme : theme ,
5154 layout : "modern" ,
5255 hideDownloadButton : false ,
5356 hideModels : false
5457 } ) ;
5558 } ) ;
59+ /*]]>*/
5660</ script >
5761</ body >
5862</ html >
You can’t perform that action at this time.
0 commit comments