Repository navigation
Conversation
…5 endpoints lose nested objects)
resolveSchema 对 {$ref, description} 形状的属性没有任何分支——没有
type 字段,array/object 检查都不命中,引用的 schema 从未被解析。
对线上 /api/v2/docs 规范实测:60/225 个带 201 schema 的端点至少
丢失一个嵌套对象(66 个不同对象——所有 /api/v2/metrics/* 的
metric_detail + TpcItem.scorecard)。
ResponsesViewer 的 hasChildren 只检查 value.items,解析出的
properties 仍然渲染为叶子——value.items || value.properties
的回退不可达。
修复:resolveSchema 新增 $ref 分支(递归解析引用的 schema),
导出为可测纯函数;ResponsesViewer 用统一的 childData(items 或
properties)判定可展开性与渲染。
新增 useMenuContent.test.ts:$ref 解析/array-of-$ref 回归/
未知 schema 三例。
|
@zjncs is attempting to deploy a commit to the codersett's projects Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
This branch has not been deployed
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.
Problem
resolveSchemahas no branch for direct$refproperties —{"$ref": "#/definitions/X", "description": "..."}has notype, so neither the array nor object branch fires. The referenced schema's properties are never resolved.Verified against the live
/api/v2/docsspec: 67 properties declared as plain$ref. 60 of 225 endpoints with a 201 schema lose at least one nested object (66 distinct objects — everymetric_detail+TpcItem.scorecard).Second layer:
ResponsesViewer'shasChildrenonly inspectsvalue.items— thevalue.items || value.propertiesfallback is unreachable.Fix
resolveSchema: add a$refbranch (recursively resolve the referenced schema).resolveSchema(definitions, propDef.type)for inline objects.ResponsesViewer: unifiedchildData(items or properties) for bothhasChildrenand render.resolveSchemafor testability.Verification
3 tests: $ref resolution (RED before — no branch), array-of-$ref regression guard, unknown schema. Full dataHub suite: 3/3 passed.