flatten: allOf silently drops 3.1-specific schema keywords
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start in flatten/allof/merge_allof.go and read how the existing MinItems/MaxItems and type-conflict logic merges subschemas. Pick one of the easy items, such as Const or MinContains/MaxContains, and add its merge rule following that pattern. Check docs/ALLOF.md for the documented field list. Done means the keyword is merged or reports a conflict, with a test covering it.
由索引模型根据 Issue 内容生成。
描述
Follow-up to #868 / #873.
flatten/allof/merge_allof.go doesn't reference any 3.1-specific schema keyword introduced by JSON Schema 2020-12. Every one of the 18 keywords below is silently dropped from the merged schema today — same class of bug as the numeric exclusiveMinimum / exclusiveMaximum issue that #873 just fixed.
Verified by grepping each field name against flatten/allof/merge_allof.go on main after #873 merge — zero references for all of them.
Easy — mirror existing patterns
Small, mechanical fixes. Land each in its own PR (or in one small batch).
-
Const— must be equal across subschemas; conflict if not (mirrors existing type-conflict logic). High priority — likely to appear in real specs. -
MinContains/MaxContains— mirrorsMinItems/MaxItems(most-restrictive wins). -
ContentMediaType/ContentEncoding— string equality, conflict if mismatched. -
DependentRequired— union ofmap[string][]stringentries. -
$defs(Defsin kin-openapi) — copy/merge by name.
Medium — schema-valued, need recursive merge
-
Contains/PropertyNames— single*SchemaRef; the conjunction is the merged schema of all subschemas' values. -
PatternProperties/DependentSchemas—Schemasmap; merge by key with recursive merge on value collisions. -
PrefixItems—SchemaRefsslice; merge position-by-position.
Hard — semantics don't compose cleanly
For these, we should decide at the product level whether flatten errors out (safer) or silently approximates (today's behavior, but the result may be misleading).
-
If/Then/Else— conditional logic; the conjunction of twoif/then/elseschemas can't be expressed as a singleif/then/elsein general. -
UnevaluatedItems/UnevaluatedProperties— semantics depend on which sibling keywords were considered "evaluating"; merging changes that context.
Out of scope
A few non-3.1 fields are also not merged today (XML, ExternalDocs, Example, Deprecated, AllowEmptyValue) and are documented as such in docs/ALLOF.md. Those are a separate decision.
- 主要语言
- Go
- 星标
- 1.4k
- 派生
- 109
- 平均合并
- 12 小时 27 分钟
- 30 天内合并 PR
- 36
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
oasdiff/oasdiff 的其他 Issue
-
难度 5/5 一周以上 新手友好度 45/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 55/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 52/100
维护者通常 1 天内回复
-
Changing the `type` of a security scheme in use (apiKey → http bearer) is reported at info可能已有人在做 @reuvenharrison 于 1 天前认领。 未关闭
难度 3/5 半天 新手友好度 68/100
维护者通常 1 天内回复
-
Securing an anonymous operation is info, while making a secured operation anonymous is an error可能已有人在做 @reuvenharrison 于 1 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 75/100
维护者通常 1 天内回复
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 1 天内回复
-
agent-research agent-review-finding chore
难度 2/5 1-3 小时 新手友好度 66/100
jordansmall/spindrift#4922 ·
维护者通常 1 天内回复
-
gcsartifact: deleting a missing version returns an error可能已有人在做 @ktsoator 今天认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复
-
govulncheck
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
Change wording for init command success message可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 1/5 1 小时以内 新手友好度 82/100
维护者通常 1 天内回复