chore: openapi doc generator (#2644)

* chore: extract the type and comment from apis

* chore: template code

* feat: openapi

* pref: openapi generator. send into public/openapi folder
This commit is contained in:
Finley Ge
2024-09-09 15:43:09 +08:00
committed by GitHub
parent 5f3c8e9046
commit 78ad2791cd
12 changed files with 2214 additions and 24 deletions

22
scripts/openapi/type.d.ts vendored Normal file
View File

@@ -0,0 +1,22 @@
export type ApiMetaData = {
name?: string;
author?: string;
version?: string;
};
export type ApiType = {
description?: string;
path: string;
url: string;
query?: itemType | itemType[];
body?: itemType | itemType[];
response?: itemType | itemType[];
method: 'GET' | 'POST' | 'PUT' | 'DELETE';
} & ApiMetaData;
export type itemType = {
comment?: string;
key?: string;
type: string;
required?: boolean;
};