redskap / swagger-brake

Swagger contract checker for breaking API changes
Apache License 2.0
57 stars 16 forks source link

Include version number into report and filename #107

Closed fairking closed 9 months ago

fairking commented 1 year ago

Hi everyone,

Is the any way to include the version number to the report and filename?

For example the following command:

java -jar "..\..\Utils\SwaggerBrake\swagger-brake-2.3.0-cli.jar" --old-api=schema_old.json --new-api=schema.json --output-formats=HTML --output-path=.\

Would generate the following file: swagger-brake-1.0.1.html. and the version also included into the document itself: image

The version number is determined by the schema.json (see info.version)

{
  "openapi": "3.0.1",
  "info": {
    "title": "My Project API",
    "description": "Ground breaking software",
    "version": "1.0.1"
  },

It would be also nice to customize the report filename as well (eg. my-project-breaking-changes.html).

Thanks.

galovics commented 1 year ago

Hi @fairking. Currently you can't customize the report and the name of the report file although it shouldn't be a big deal to implement those things.

Before we do that, would you mind explaining a bit your use-case? Thanks

fairking commented 1 year ago

Hi @fairking. Currently you can't customize the report and the name of the report file although it shouldn't be a big deal to implement those things.

Before we do that, would you mind explaining a bit your use-case? Thanks

I am generating a report on every release so I would like to keep a history of all report versions and also I am sharing such reports among third parties. So the version number would be a very useful hint for reference. I know I can rename the file name but having a version number inside the report would be very beneficial.

galovics commented 1 year ago

Noted, thanks @fairking for the explanation.

galovics commented 9 months ago

Will look like this: image

galovics commented 9 months ago

Done in https://github.com/redskap/swagger-brake/pull/115