feat: specify the api's auth type (#2715)

This commit is contained in:
Finley Ge
2024-09-15 13:06:51 +08:00
committed by GitHub
parent d0e8f7203c
commit 1ebc95a282
5 changed files with 103 additions and 25 deletions

View File

@@ -4,7 +4,7 @@ import * as path from 'path';
import { convertOpenApi } from './openapi';
const rootPath = 'projects/app/src/pages/api';
const exclude = ['/admin', '/proApi'];
const exclude = ['/admin', '/proApi', 'test.ts'];
function getAllFiles(dir: string) {
let files: string[] = [];
@@ -39,6 +39,22 @@ const openapi = convertOpenApi({
version: '1.0.0',
author: 'FastGPT'
},
components: {
securitySchemes: {
apiKey: {
type: 'apiKey',
name: 'Authorization',
in: 'header',
scheme: 'bearer'
},
token: {
type: 'apiKey',
in: 'token',
name: 'token',
scheme: 'basic'
}
}
},
servers: [
{
url: 'http://localhost:4000'