OpenAPITools / OpenAPITools/openapi-diff

Mark down changelog generation - enum rename interpreted as added

Open
#828 1 comment 1 reaction 1 assignee View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.1k
Forks
190
PR merge metrics
No merged PRs in 30d

Description

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`

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.