mirror of
https://github.com/fosrl/pangolin.git
synced 2026-07-17 07:04:36 -05:00
[PR #3102] [MERGED] Improve OpenAPI response payload typing for Swagger data schemas #37982
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/fosrl/pangolin/pull/3102
Author: @Copilot
Created: 5/17/2026
Status: ✅ Merged
Merged: 5/31/2026
Merged by: @oschwartz10612
Base:
main← Head:copilot/fix-documentation-input-output-types📝 Commits (5)
9cec711Fix custom parser OpenAPI types and add structured default response schemaa0a093eDocument all registerPath responses and normalize OpenAPI parser schemas15a9eb2Add concrete OpenAPI data schemas for selected routesf3bee70Reformat generated OpenAPI response schemas for readability81ed391Remove obsolete stoi import from blueprint OpenAPI route📊 Changes
183 files changed (+2875 additions, -245 deletions)
View changed files
📝
server/integrationApiServer.ts(+9 -3)📝
server/lib/ip.ts(+7 -1)➕
server/lib/openapi/createApiResponseSchema.ts(+11 -0)📝
server/private/routers/alertRule/createAlertRule.ts(+16 -1)📝
server/private/routers/alertRule/deleteAlertRule.ts(+16 -1)📝
server/private/routers/alertRule/getAlertRule.ts(+16 -1)📝
server/private/routers/alertRule/listAlertRules.ts(+16 -1)📝
server/private/routers/alertRule/updateAlertRule.ts(+15 -1)📝
server/private/routers/approvals/processPendingApproval.ts(+1 -1)📝
server/private/routers/auditLogs/exportAccessAuditLog.ts(+17 -1)📝
server/private/routers/auditLogs/exportActionAuditLog.ts(+17 -1)📝
server/private/routers/auditLogs/exportConnectionAuditLog.ts(+17 -1)📝
server/private/routers/auditLogs/queryAccessAuditLog.ts(+16 -1)📝
server/private/routers/auditLogs/queryActionAuditLog.ts(+16 -1)📝
server/private/routers/auditLogs/queryConnectionAuditLog.ts(+16 -1)📝
server/private/routers/billing/getOrgUsage.ts(+16 -1)📝
server/private/routers/certificates/getCertificate.ts(+16 -1)📝
server/private/routers/certificates/restartCertificate.ts(+18 -3)📝
server/private/routers/domain/checkDomainNamespaceAvailability.ts(+16 -1)📝
server/private/routers/domain/listDomainNamespaces.ts(+27 -1)...and 80 more files
📄 Description
Swagger response docs were still advertising
dataasunknown | null, which hid the actual payload shape for many endpoints. This change starts replacing those generic envelopes with route-specific response schemas so successful responses are inspectable in the docs.Response envelope helper
createApiResponseSchema(...)to standardize the outer API envelope while allowing each route to provide a concretedataschema.data,success,error,message,status) without repeating the wrapper logic in every route.Concrete
dataschemas for high-confidence routesz.unknown().nullable()with route-specific payload schemas for a first set of routes where the response shape was already explicit or easy to derive.Swagger usability improvements
unknown.Cleanup
registerPath(...)blocks that were malformed by the earlier bulk response replacement.stoiimport left behind after parser normalization.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.