mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 21:13:50 +00:00

* fix: plugin update * feat: get current time plugin * fix: ts * perf: select app ux * fix: ts * perf: max w * move code * perf: inform tip * fix: inform * doc * fix: tool handle * perf: tmp file store * doc * fix: message file selector * feat: doc * perf: switch trigger * doc * fix: openapi import * rount the number * parse openapi schema * fix empty line after variables (#64) * doc image * image size * doc * doc * catch error --------- Co-authored-by: heheer <71265218+newfish-cmyk@users.noreply.github.com>
16 lines
383 B
TypeScript
16 lines
383 B
TypeScript
import SwaggerParser from '@apidevtools/swagger-parser';
|
|
|
|
export const loadOpenAPISchemaFromUrl = async (url: string) => {
|
|
return SwaggerParser.bundle(url);
|
|
};
|
|
|
|
export const checkOpenAPISchemaValid = async (str: string) => {
|
|
try {
|
|
const res = await SwaggerParser.validate(JSON.parse(str));
|
|
console.log(res);
|
|
return !!res;
|
|
} catch (error) {
|
|
return false;
|
|
}
|
|
};
|