Repository navigation
fix(axios-sdk): 路径参数兜底提取 (issue #27) - #195
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #195 +/- ##
=======================================
Coverage 99.86% 99.86%
=======================================
Files 28 28
Lines 2962 2968 +6
Branches 913 916 +3
=======================================
+ Hits 2958 2964 +6
Misses 4 4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
yourtion
force-pushed
the
fix/path-params-sdk-gen
branch
from
July 9, 2026 05:14
0612939 to
341cffd
Compare
getPathParams 此前只读 paramsSchema,与 getReqSendPath(看路径串)脱节。 当路由为 /:id 但未声明 params schema 时,生成路径引用了 id 变量, 函数签名却没有 id 参数 → 坏 SDK。 现在 getPathParams 在 paramsSchema 为空时从 realPath 的 :xxx 兜底提取, 保证签名与路径一致。已声明 paramsSchema 的场景行为不变。 - 新增 3 个回归测试(声明 params / 未声明 fallback / 无路径参数) - bump 版本 3.2.1 → 3.2.3,登记 MIGRATION
yourtion
force-pushed
the
fix/path-params-sdk-gen
branch
from
October 27, 2026 02:39
341cffd to
1fc8eee
Compare
This was referenced Oct 27, 2026
This was referenced Oct 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #27
修复未声明 params schema 的 Axios SDK 路径参数:签名与插值共用提取规则,支持参数名中的数字、下划线以及以下划线开头的名称,保留 main 正确的模板插值。路径参数按路由顺序提供。
新增实际执行生成 ESM 并发出真实 Axios HTTP 请求的回归,覆盖已声明 schema、无 schema、数字/下划线参数名及无路径参数。旧实现的下划线路径已复现为 ESM SyntaxError,修复后通过。更新了原有精确 SDK 输出断言。
验证:608 个源码/覆盖率用例通过,核心与四个子包构建、lint/格式检查通过。Axios 仅新增为开发测试依赖;无新增生产依赖。
基于修正后的 #218;按 #218 → #195 → #196 → #197 → #219 顺序合并。五包版本记录 3.2.4,待最终 3.3.0 整合后统一发布,不发布中间版本。正式 CI 以最新 head 为准。