fix: refine Swagger docs headers and dynamic examples

This commit is contained in:
MythEclipse
2026-05-18 07:43:15 +07:00
parent 6feca3564a
commit 9aedc59b69
+5 -1
View File
@@ -1,3 +1,5 @@
import { config } from '../env';
const errorSchema = (example: string) => ({ const errorSchema = (example: string) => ({
type: 'object', type: 'object',
properties: { properties: {
@@ -117,7 +119,7 @@ export const handleSwaggerJson = async (): Promise<Response> => {
}, },
download_url: { download_url: {
type: 'string', type: 'string',
example: 'https://tele.asepharyana.tech/f/xYz123', example: `${config.baseUrl}/f/xYz123`,
}, },
}, },
}), }),
@@ -269,6 +271,8 @@ export const handleSwaggerHtml = async (): Promise<Response> => {
status: 200, status: 200,
headers: { headers: {
'content-type': 'text/html; charset=utf-8', 'content-type': 'text/html; charset=utf-8',
'access-control-allow-origin': '*',
'x-content-type-options': 'nosniff',
}, },
}); });
}; };