OpenAPITools / OpenAPITools/openapi-diff

Output in text and markdown not equivalent (text output incomplete)

Open
#620 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

The text output which is printed by default by the CLI doesn't show all the information that the markdown output shows:

spec1.yaml
components:
  schemas:
    SomeDTO:
      someProperty:
        type: string
        enum:
          - ENUM_VALUE_1
          - ENUM_VALUE_2
spec2.yaml
components:
  schemas:
    SomeDTO:
      someProperty:
        type: string
        enum:
          - ENUM_VALUE_1
          - ENUM_VALUE_2
          - ENUM_VALUE_3

markdown output
#### What's Changed
---

##### `GET` /resources1/{id}/resources2


###### Return Type:

Changed response : **200 OK**
> OK


* Changed content type : `application/json`

    Changed items (object):

    * Changed property `someProperty` (string)

        Added enum value:

        * `ENUM_VALUE_3`

text output
==========================================================================
==                            API CHANGE LOG                            ==
==========================================================================
             API for Umetrics Core Project Management Service             
--------------------------------------------------------------------------
--                            What's Changed                            --
--------------------------------------------------------------------------
  Return Type:
    - Changed 200 OK
      Media types:
        - Changed application/json
          Schema: Broken compatibility
- GET    /resources1/{id}/resources2
                 API changes broke backward compatibility                 
--------------------------------------------------------------------------

text output tells nothing about what actually broke backwards compatibility, but since it's the stdout of the process it should show everything that's needed to determine the reason of the problem.

Alternative solution: give an option to decide which kind of output: text/markdown/json should be printed to stdout.

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.

Research direction

Start with the CLI path that produces the shown text output and compare it with the markdown formatter. Use the provided spec1.yaml and spec2.yaml example to verify that stdout identifies the changed property and enum value, or that an explicit output-format option is available.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, openapi
Domain
api, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.