OpenAPITools / OpenAPITools/openapi-diff

Mark down changelog generation - enum rename interpreted as added

未关闭
#828 1 条评论 1 个 reaction 已指派 1 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Java
星标
1.1k
派生
190
PR 合并指标
30 天内没有已合并 PR

描述

I tested that on version 2.1.2 and 2.1.3. This unusual case but happened.

The following is modified excerpt of the json files. One of the enum field has bee renamed from 'StatusThree' to 'StatusNew'.

Then the change log has been generated in mark down format. The ideal case would be markdown reporting field renamed from A to B. The second best would be. A removed. B added. However markdown report states only the fact that B has been added.

Old Version:

{
    "definitions": {
        "SomeStatus": {
            "description": "Some status description",
            "enum": [
                "StatusOne",
                "StatusTwo",
                "StatusThree"
            ],
            "type": "string",
            "x-ms-enum": {
                "name": "SomeStatus",
                "modelAsString": false,
                "values": [
                {
                    "name": "StatusOne",
                    "value": "StatusOne"
                },
                {
                    "name": "StatusTwo",
                    "value": "StatusTwo"
                },
                {
                    "name": "StatusThree",
                    "value": "StatusThree"
                }
                ]
            }
        }
    }
}

New version:

{
    "definitions": {
        "SomeStatus": {
            "description": "Some status description",
            "enum": [
                "StatusOne",
                "StatusTwo",
                "StatusNew"
            ],
            "type": "string",
            "x-ms-enum": {
                "name": "SomeStatus",
                "modelAsString": false,
                "values": [
                {
                    "name": "StatusOne",
                    "value": "StatusOne"
                },
                {
                    "name": "StatusTwo",
                    "value": "StatusTwo"
                },
                {
                    "name": "StatusNew",
                    "value": "StatusNew"
                }
                ]
            }
        }
    }
}

Markdown output:

Changed response : 200 OK

Changed items (object):

* Changed property `status` (string)

    Added enum value:

    * `StatusNew`

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。