Sayi / swagger-diff

:ski: Compare two swagger API specifications(1.x or v2.0)
http://deepoove.com/swagger-diff/
Apache License 2.0
273 stars 85 forks source link

Add support for vendor extensions #15

Open egoodhall opened 6 years ago

egoodhall commented 6 years ago

Thank you for everything you've done on this library, it's awesome. I'm currently using it in a project uses vendor extensions, and while it seems that vendor extensions aren't currently supported by swagger-diff, I currently have a local implementation that supports vendor extensions in all of the Swagger 2.0 supported locations.

It's a sizable change, due to the fact that vendor extensions can be found in so many places throughout swagger specifications, and the rendering has to be modified as well to fit this. If you think there's a better way to do this, or have strong opinions on whether/how it should be exposed, I'd love any suggestions.

Sayi commented 6 years ago

I have not used vendor extensions, you will do better than me.

egoodhall commented 6 years ago

Hi again, I've made a pull request that adds support for vendor extension diffing. It doesn't make any breaking changes to the API, so it shouldn't break any existing code. It does add overloaded compareV1 and compareV2 methods, with an additional boolean argument withExtensions that will enable vendor extension diffing if set to true. I'd appreciate if you could take a look at it when you get the chance, and let me know if there's anything I can do to help get it merged/deployed