Tufin / oasdiff

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

Verbose CLI output to help troubleshoot (especially in composed mode) #495

Closed anikitin closed 6 months ago

anikitin commented 6 months ago

Trying to troubleshoot an issue when running oasdiff in composed mode (I use oasdiff 1.10.9) It really lacks the option to show what file (and endpoint/operation) it is currently processing.

I.e. I am trying to generate a changelog from a tree with hundreds of openapi files in composed mode (with --flatten-allof). And I am getting just this in output:

Error: failed to load base specs from glob "../api-metadata-specs2/openapi/*/*-openapi.yml" with unable to resolve Enum conflict: intersection of values must be non-empty

At this point I just need something like --verbose to get more information about where it stopped. Then I will try to figure out what is wrong top report a different issue (maybe)

anikitin commented 6 months ago

@reuvenharrison , any hint on how to understand what file/element is triggering this error?

tcdsv commented 6 months ago

Hey This error occurs when trying to merge schemas that have entirely separate enum value sets. Because there are no shared enum values, there is no data that could be considered valid against both of the schemas.

This kind of issue can appear in schemas that use an allOf component and have more than one enum field.

anikitin commented 6 months ago

@tcdsv , thanks. I would be happy to dig deeper into this problem, but I need to understand what particular file and schema triggered it (out of 200+ I included into scan)...

Actually all our specs are validated and linted, so there should be no incompatibilities in terms of OpenAPI standard.

reuvenharrison commented 6 months ago

Hi @anikitin, As a first step to resolve this I suggest adding the problematic file name to the error message, like this:

Error: failed to load base specs from glob "../api-metadata-specs2/openapi/*/*-openapi.yml" with failed to load "path-to-problematic-file" with unable to resolve Enum conflict: intersection of values must be non-empty

What do you think?

anikitin commented 6 months ago

@reuvenharrison , yes, for sure. But since files can be pretty big we need also to refer somehow to problematic schema/component within this file as well.