enh: allow custom openapi json url
This commit is contained in:
@@ -346,11 +346,15 @@ export const getToolServersData = async (i18n, servers: object[]) => {
|
||||
.map(async (server) => {
|
||||
const data = await getToolServerData(
|
||||
(server?.auth_type ?? 'bearer') === 'bearer' ? server?.key : localStorage.token,
|
||||
server?.url + '/' + (server?.path ?? 'openapi.json')
|
||||
(server?.path ?? '').includes('://')
|
||||
? server?.path
|
||||
: `${server?.url}${(server?.path ?? '').startsWith('/') ? '' : '/'}${server?.path}`
|
||||
).catch((err) => {
|
||||
toast.error(
|
||||
i18n.t(`Failed to connect to {{URL}} OpenAPI tool server`, {
|
||||
URL: server?.url + '/' + (server?.path ?? 'openapi.json')
|
||||
URL: (server?.path ?? '').includes('://')
|
||||
? server?.path
|
||||
: `${server?.url}${(server?.path ?? '').startsWith('/') ? '' : '/'}${server?.path}`
|
||||
})
|
||||
);
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user