Formatting tool

Issue #31 new
Lasse Viggo created an issue

Hello,

In neither projects (openapi-diff or json-schema-diff) appear to support formatting CLI options outside of json.

is that something that is planned or does such tool already exist?

I’d like to include the tool in our pipelines, but readability when presented to engineers is a requirement: similar to npm audit

Proposal:

introduce a --format flag presenting findings in human readable format

openapi-diff "x" "y" --format pretty

example output

[breaking change] Rule: path.remove, Path remove paths./transactions

[non-breaking change] Rule: path.add, Path add paths./transactions/x
[non-breaking change] Rule: path.add, Path add paths./transactions/y
[non-breaking change] Rule: path.add, Path add paths./transactions/{transactionId}
[non-breaking change] Rule: path.add, Path add paths./transactions/{transactionId}

Comments (2)

  1. Sebastian Tello Account Deactivated

    Hi @Lasse Viggo thanks for the suggestion. Reporting definitely needs some love.. not just the format but also verbosity. We could include some built-in formats and also allow some sort of plugin system to allow custom reporters (e.g. generating an html report or similar).

    I’m not sure when we will have time or resources to tackle this. In the meantime you could try invoking the tool from the programmatic interface (https://bitbucket.org/atlassian/openapi-diff/src/dec77d66a957c376e7be260014423bddd5ad2425/lib/api-types.d.ts#lines-96, also see the “Usage as a nodejs api” section in the readme) and present the results as it fits your needs.

  2. Lasse Viggo reporter

    If we decide to use the tool for our CI setup, we’ll make a MR with a proposal for formatting support.

  3. Log in to comment