Just add ordering

This commit is contained in:
Owen
2026-07-10 16:01:22 -04:00
parent 0149984e85
commit 1af486ac48
2 changed files with 16 additions and 10 deletions
+3 -2
View File
@@ -12,7 +12,7 @@ import { logIncomingMiddleware } from "./middlewares/logIncoming";
import helmet from "helmet";
import swaggerUi from "swagger-ui-express";
import { OpenApiGeneratorV3 } from "@asteasolutions/zod-to-openapi";
import { registry } from "./openApi";
import { registry, openApiTags } from "./openApi";
import fs from "fs";
import path from "path";
import { APP_PATH } from "./lib/consts";
@@ -181,7 +181,8 @@ function getOpenApiDocumentation() {
version: "v1",
title: "Pangolin Integration API"
},
servers: [{ url: "/v1" }]
servers: [{ url: "/v1" }],
tags: openApiTags
});
if (!process.env.DISABLE_GEN_OPENAPI) {
+13 -8
View File
@@ -4,24 +4,29 @@ export const registry = new OpenAPIRegistry();
export enum OpenAPITags {
Site = "Site",
Org = "Organization",
PublicResource = "Public Resource",
PublicResourceLegacy = "Public Resource (Legacy)",
Target = "Resource Target",
PrivateResource = "Private Resource",
PrivateResourceLegacy = "Private Resource (Legacy)",
Client = "Client",
Org = "Organization",
Domain = "Domain",
Policy = "Policy",
Role = "Role",
User = "User",
Invitation = "User Invitation",
Target = "Resource Target",
Rule = "Rule",
Invitation = "User Invitation",
AccessToken = "Access Token",
GlobalIdp = "Identity Provider (Global)",
OrgIdp = "Identity Provider (Organization Only)",
Client = "Client",
ApiKey = "API Key",
Domain = "Domain",
Blueprint = "Blueprint",
Ssh = "SSH",
Logs = "Logs"
Logs = "Logs",
PublicResourceLegacy = "Public Resource (Legacy)",
PrivateResourceLegacy = "Private Resource (Legacy)"
}
// Order here controls the order tags are displayed in Swagger UI
export const openApiTags = Object.values(OpenAPITags).map((name) => ({
name
}));