zallek / swagger-diff

Compute the diff between two swagger API specifications.
https://zallek.github.io/swagger-diff/
58 stars 30 forks source link

unmatched diff section #15

Open mattadamson opened 8 years ago

mattadamson commented 8 years ago

I'm very interested in using this tool to help identify differences between API versions. I noted we have a large number of lines reported in the unmatchDiffs section of kind equals to E. I'm not 100% clear why we see them from the swagger definitions. The help indicate

Note: unmatchDiffs are the raw diffs that didn't much any rules. They can include breakings changes not implemented yet.

Looking at our swagger definitions we can see the same required attributes marked for a particular model however version A does specify them in a slightly different order to version B. Should order be included as a difference in this way within a definition?

zallek commented 7 years ago

Hi, and sorry for the very late answer. Being buzy on other projects. I'll investigate on it.

zallek commented 7 years ago

Before comparing the swagger files, they are slightly modified to make them easier to compare and to allow to not care about order when it's not needed. One of these steps is named workflow/prepareSpec/inlineRequiredProperties and should indeed allow to not care about order in required properties.

Example: Initial swagger definition: https://github.com/zallek/swagger-diff/blob/master/test/workflow/prepareSpec/inlineRequiredProperties/1-input.json Transformed swagger definition: https://github.com/zallek/swagger-diff/blob/master/test/workflow/prepareSpec/inlineRequiredProperties/1-output.json

Could you tell me if your swagger file comply with one of the cases listed in the tests: https://github.com/zallek/swagger-diff/tree/master/test/workflow/prepareSpec/inlineRequiredProperties

Or give me some gists containing your swagger files so that I can understand the problem pls ?

Thanks.