ChangedSchema in a readOnly property for requestBody is not filtered out from the result.
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 48/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- java
调研方向
首先使用 Old API 和 New API 示例重现该问题,重点关注请求体中 readOnly bar 属性的 ChangedSchema 和 ChangedOpenApi 结果。跟踪已更改的 Bar schema 如何从请求体兼容性检查中过滤掉,但仍保留在 ChangedSchema 中;完成的标准是,最终的变更列表和兼容性输出不再报告该已过滤的变更。
由索引模型根据 Issue 内容生成。
描述
Old API
{
"openapi":"3.0.0",
"info":{
"title":"API",
"version":"0.1.0"
},
"paths":{
"/resource":{
"post":{
"responses":{
"200":{
"description":"Created resource",
"content":{
"application/json":{
"schema":{
"$ref":"#/components/schemas/CreateResourceResponse"
}
}
}
}
},
"summary":"Create resource",
"requestBody":{
"content":{
"application/json":{
"schema":{
"$ref":"#/components/schemas/CreateResourceRequest"
}
}
},
"description":"Definition of the resource"
}
}
}
},
"components": {
"schemas": {
"CreateResourceResponse": {
"type": "object",
"properties": {
"resources": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"CreateResourceRequest": {
"type": "object",
"properties": {
"foo": {
"$ref": "#/components/schemas/Foo"
}
}
},
"Foo": {
"type": "object",
"properties": {
"bar": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Bar"
},
"readOnly": true
}
}
},
"Bar": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
}
}
}
}
}
New API
{
"openapi":"3.0.0",
"info":{
"title":"API",
"version":"0.1.0"
},
"paths":{
"/resource":{
"post":{
"responses":{
"200":{
"description":"Created resource",
"content":{
"application/json":{
"schema":{
"$ref":"#/components/schemas/CreateResourceResponse"
}
}
}
}
},
"summary":"Create resource",
"requestBody":{
"content":{
"application/json":{
"schema":{
"$ref":"#/components/schemas/CreateResourceRequest"
}
}
},
"description":"Definition of the resource"
}
}
}
},
"components": {
"schemas": {
"CreateResourceResponse": {
"type": "object",
"properties": {
"resources": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"CreateResourceRequest": {
"type": "object",
"properties": {
"foo": {
"$ref": "#/components/schemas/Foo"
}
}
},
"Foo": {
"type": "object",
"properties": {
"bar": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Bar"
},
"readOnly": true
}
}
},
"Bar": {
"type": "object",
"properties": {
"name": {
"type": "integer"
}
}
}
}
}
}
In this example, the property bar in Foo schema is a readOnly property and Foo is referenced by request body of the endpoint.
When Bar schema is changed, it's filtered out from the request body but the change exists in the list of ChangedSchema in ChangedOpenApi, which results incompatible changes but shows nothing.
==========================================================================
== API CHANGE LOG ==
==========================================================================
API
--------------------------------------------------------------------------
-- Result --
--------------------------------------------------------------------------
API changes broke backward compatibility
--------------------------------------------------------------------------
- 主要语言
- Java
- 星标
- 1.1k
- 派生
- 190
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
OpenAPITools/openapi-diff 的其他 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 68/100
OpenAPITools/openapi-diff#506 ·
-
good first issue help wanted
难度 2/5 1-3 小时 新手友好度 68/100
OpenAPITools/openapi-diff#364 ·
-
bug OpenAP 3.1.0 Support
难度 3/5 1-2 天 新手友好度 68/100
OpenAPITools/openapi-diff#910 · 1 条评论 ·
-
Render capabilities
难度 3/5 1-2 天 新手友好度 55/100
OpenAPITools/openapi-diff#893 · 1 条评论 ·
-
Breaking/Non-Breaking classification
难度 3/5 1-2 天 新手友好度 55/100
OpenAPITools/openapi-diff#886 ·
查看 OpenAPITools/openapi-diff 的全部 Issue
相似的 Issue
-
awaiting triage bug Causes friction Hop Gui P1 P2 Transforms
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 75/100
apache/flink-agents#1152 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 70/100
jenkinsci/blueocean-plugin#5417 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
objectionary/eo-graphs#75 ·