swagger ui options

This commit is contained in:
Mohan Gupta
2023-09-14 17:51:41 +10:00
parent 47a5b26abc
commit b58f6379cf
6 changed files with 101 additions and 7 deletions
+4 -1
View File
@@ -33,7 +33,10 @@ const app = new Elysia({
}
}
}
}
},
swaggerOptions: {
persistAuthorization: true
},
})
)
.use(plugin)
+46
View File
@@ -0,0 +1,46 @@
import { Elysia } from 'elysia'
import { swagger } from '../src/index'
import { plugin } from './plugin'
const app = new Elysia({
// aot: false
})
.use(
swagger({
documentation: {
info: {
title: 'Elysia',
version: '0.6.10'
},
tags: [
{
name: 'Test',
description: 'Hello'
}
],
security: [
{JwtAuth: []}
],
components: {
schemas: {
User: {
description: 'string'
}
},
securitySchemes: {
JwtAuth: {
type: 'http',
scheme: 'bearer',
bearerFormat: 'JWT',
description: 'Enter JWT Bearer token **_only_**'
}
}
}
},
swaggerOptions: {
persistAuthorization: true
},
})
)
.use(plugin)
.listen(8080)