Tufin / oasdiff

OpenAPI Diff and Breaking Changes
https://www.oasdiff.com
Apache License 2.0
763 stars 63 forks source link

Infos/result are reported multiple times #594

Open mouradchama opened 3 months ago

mouradchama commented 3 months ago

Describe the bug I'm testing the pluging the implement the api changelog and reporting the breraking change for our Apis. The pluging seems working file except the noises that it generates, each info is reported mulitiple times.

To Reproduce Steps to reproduce the behavior:

  1. The command-line, for example: oasdiff changelog oas_original.json oas_non_breaking_changes.json

  2. Spec 1: oas_original.json

  3. Spec 2: oas_non_breaking_changes.json

  4. Output image

Expected behavior The infos/result should be merged and reported only once

Desktop (please complete the following information):

reuvenharrison commented 3 months ago

Hi @mouradchama, I couldn't replicate this problem using the command and files you provided. Could you please check that the instructions are precise?

Also, you mention a "plugin", I am not sure what you mean by that.

Thanks, Reuven

reuvenharrison commented 3 months ago

Update: I successfully replicated the issue (it didn't work yesterday due to another problem that I fixed meanwhile). I'll update shortly with more info.

reuvenharrison commented 3 months ago

The triple messages are actually correct, each one belongs to a different media type. The fix will change all request property messages to include the media-type, for example:

image
reuvenharrison commented 2 months ago

Update: Oasdiff currently omits media-type for changes in requests and responses. Fixing this will require adding the media type to all breaking change messages under requests and responses. Ideally, we should also avoid displaying the media-type when there is only one media-type, this will keep messages short and readable for the majority of specs. We will fix this in several steps:

  1. Automate message generation (see https://github.com/Tufin/oasdiff/pull/604)
  2. Support two types of messages: with media-type and without media type
  3. Gradually add media-type to relevant checks