Skip to content

feat(docs): Swagger/Postman 展示返回结果 response schema (issue #6)#194

Merged
yourtion merged 1 commit into
mainfrom
feat/swagger-response-schema
Jul 9, 2026
Merged

feat(docs): Swagger/Postman 展示返回结果 response schema (issue #6)#194
yourtion merged 1 commit into
mainfrom
feat/swagger-response-schema

Conversation

@yourtion

@yourtion yourtion commented Jul 1, 2026

Copy link
Copy Markdown
Owner

关联 issue

Closes #6

改动内容

  • Swaggerresponses.200 输出标准 schema(type/properties/required),此前写死 { description: "请求成功" } 完全忽略 responseSchema
  • Postman:每个 item 输出 response 示例(按 schema 字段名+类型生成占位 body)
  • 两者都复用 extractDocFields,与参数提取保持一致
  • 未声明 response schema 时保持原有占位行为不变(向后兼容)

测试

  • 新增 5 个回归测试(swagger 3 + postman 2)
  • 全量 npm run test:lib:317 → 322 全绿
  • tsc --noEmit 通过

版本

bump 3.2.1 → 3.2.2,已登记 MIGRATION

合并顺序提示

本系列共 4 个 PR(#6 / #27 / #5 / #4),各基于 main 独立 bump 版本(3.2.2 / 3.2.3 / 3.2.4 / 3.2.5)。请按版本号顺序合并,从本 PR(3.2.2)开始。

- Swagger responses.200 输出标准 schema(type/properties/required),
  复用 extractDocFields 与参数提取保持一致;未声明 response 时保持占位
- Postman item 输出 response 示例(按 schema 字段名+类型生成占位 body)
- 新增 5 个回归测试(swagger 3 + postman 2)
- bump 版本 3.2.1 → 3.2.2,登记 MIGRATION
@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.61017% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.54%. Comparing base (1a5d8cc) to head (c98cfa9).

Files with missing lines Patch % Lines
src/lib/plugin/generate_postman/index.ts 93.93% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #194      +/-   ##
==========================================
+ Coverage   92.47%   92.54%   +0.07%     
==========================================
  Files          28       28              
  Lines        2883     2939      +56     
  Branches      747      770      +23     
==========================================
+ Hits         2666     2720      +54     
- Misses        215      217       +2     
  Partials        2        2              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@yourtion yourtion merged commit ffe0ffa into main Jul 9, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add return result schema show

1 participant