Skip to content

fix(openapi): generate complete client schemas - #7787

Merged
c121914yu merged 10 commits into
labring:mainfrom
ctlaltlaltc:fix/openapi-typeless-schemas
Sep 22, 2026
Merged

c121914yu merged 10 commits into
labring:mainfrom
ctlaltlaltc:fix/openapi-typeless-schemas

Conversation

@ctlaltlaltc

@ctlaltlaltc ctlaltlaltc commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator

Problem

POST /api/admin/settings/model/create generated modelData: null because zod-openapi cannot introspect the previous z.unknown().pipe(...) schema. Other dynamic, multipart, and empty admin schemas had the same client-generation failure mode.

Changes

  • model creation now uses the real strict discriminated union, so modelData is emitted as typed oneOf branches
  • dynamic JSON/object fields declare valid OpenAPI 3.1 shapes without changing their runtime acceptance semantics
  • multipart file fields emit type: string and format: binary
  • empty requests/responses are omitted; successful mutation handlers return no business payload
  • admin request/response types are exported from shared Zod contracts and aligned with Pro runtime routes
  • added generated-document regression coverage to reject typeless schema nodes

Companion runtime PR: labring/fastgpt-pro#1158

Verification

  • targeted OpenAPI tests: 6 files, 28 tests passed
  • changed-file ESLint passed in FastGPT and fastgpt-pro
  • existing GitHub checks on the previous head were all green; checks for this head are pending
  • app/admin typecheck reports only existing dependency and SDK-version baseline errors, with no diagnostics in changed files

@github-actions

github-actions Bot commented Sep 20, 2026

Copy link
Copy Markdown

Admin Preview Image Ready!

ghcr.io/labring/fastgpt-pr:admin_9c6f32ad9eae0a83386ce35e69d187fdc90a092c

🕒 Time: 2026-09-22 22:22:51 (UTC+8)

@github-actions

github-actions Bot commented Sep 20, 2026

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 49.18% 4446 / 9039
🔵 Statements 48.91% 4702 / 9613
🔵 Functions 46.74% 875 / 1872
🔵 Branches 44.22% 2379 / 5379
File CoverageNo changed files found.
Generated in workflow #3682 for commit 9c6f32a by the Vitest Coverage Report Action

Comment thread packages/global/openapi/admin/support/user/login/api.ts Outdated
Comment thread packages/global/openapi/api.ts
Comment thread packages/global/openapi/plugin/invoke.ts Outdated
@github-actions

github-actions Bot commented Sep 20, 2026

Copy link
Copy Markdown

Build and publish successful - Preview fastgpt Image:

ghcr.io/labring/fastgpt-pr:fastgpt_9c6f32ad9eae0a83386ce35e69d187fdc90a092c

🕒 Time: 2026-09-22 22:24:30 (UTC+8)

@ctlaltlaltc ctlaltlaltc changed the title Fix/openapi typeless schemas fix(openapi): generate complete client schemas Sep 20, 2026
@ctlaltlaltc
ctlaltlaltc force-pushed the fix/openapi-typeless-schemas branch 3 times, most recently from ff4ae30 to dcc0402 Compare September 20, 2026 09:34
* Description: 通过 invoke token 获取当前运行团队的企微企业短期访问凭证
* Tags: ['Plugin', 'Invoke', 'Wecom', 'Read']
* ============================================================================ */
/** @deprecated 仅供当前 Pro 子模块过渡使用;该接口没有请求体。 */

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

等 Pro PR合并后即可删除这些 deprecated schema/type

@ctlaltlaltc
ctlaltlaltc force-pushed the fix/openapi-typeless-schemas branch from dcc0402 to 5898f76 Compare September 20, 2026 10:27
@ctlaltlaltc
ctlaltlaltc force-pushed the fix/openapi-typeless-schemas branch from 9a17b55 to 5898f76 Compare September 21, 2026 08:17
@c121914yu c121914yu self-assigned this Sep 22, 2026
@c121914yu

Copy link
Copy Markdown
Collaborator

我来合并下冲突

@c121914yu
c121914yu force-pushed the fix/openapi-typeless-schemas branch from 5898f76 to 5ca06c2 Compare September 22, 2026 09:44
@c121914yu
c121914yu merged commit 93afc77 into labring:main Sep 22, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants