0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-06 20:40:08 -05:00

chore(core): add cloud note for swagger response (#4867)

This commit is contained in:
Gao Sun 2023-11-14 11:17:06 +08:00 committed by GitHub
parent 5de7772186
commit 3e5272db41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,13 +2,14 @@ import fs from 'node:fs/promises';
import { fileURLToPath } from 'node:url';
import { httpCodeToMessage } from '@logto/core-kit';
import { conditionalArray, deduplicate } from '@silverhand/essentials';
import { condString, conditionalArray, deduplicate } from '@silverhand/essentials';
import deepmerge from 'deepmerge';
import { findUp } from 'find-up';
import type { IMiddleware } from 'koa-router';
import type Router from 'koa-router';
import type { OpenAPIV3 } from 'openapi-types';
import { EnvSet } from '#src/env-set/index.js';
import { isKoaAuthMiddleware } from '#src/middleware/koa-auth/index.js';
import type { WithGuardConfig } from '#src/middleware/koa-guard.js';
import { isGuardMiddleware } from '#src/middleware/koa-guard.js';
@ -189,7 +190,12 @@ export default function swaggerRoutes<T extends AnonymousRouter, R extends Route
openapi: '3.0.1',
info: {
title: 'Logto API references',
description: 'API references for Logto services.',
description:
'API references for Logto services. To learn more about how to interact with Logto APIs, see [Explore Management API](https://docs.logto.io/docs/tutorials/get-started/explore-management-api/).' +
condString(
EnvSet.values.isCloud &&
'\n\nNote: The documentation is for Logto Cloud. If you are using Logto OSS, please refer to the response of `/api/swagger.json` endpoint on your Logto instance.'
),
version: 'Cloud',
},
paths: Object.fromEntries(pathMap),