Sayi / swagger-diff

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

Add support for compare by JsonNode #7

Closed chrisbaldauf closed 6 years ago

chrisbaldauf commented 6 years ago

Thank you for the great work on this library. I have a use case where I have a jsonNode containing the swagger contents (and not a URI or a file). I'd prefer not to have to write this data to a file just to use this tool.

I have a local implementation that adds a compareV2Json static method to SwaggerDiff that looks a lot like compareV2 and calls a new associated private constructor. If you have strong feelings about the method name, I'm happy to adjust.

swagger-parser already has a read(JsonNode) method.

If there's a simpler way to achieve this that doesn't require a code change, I'd appreciate a pointer.

Thanks!

Sayi commented 6 years ago

The method can also use compareV2(JsonNode, JsonNode).

😄 welcome to pull request.

chrisbaldauf commented 6 years ago

Thanks for merging this in. Is there anything that I could do to help get this published? Does it need a version number to be incremented? I'm new to Java development so thanks in advance for help.

Sayi commented 6 years ago

Hi, the feature you pulled has been completed. 👍

Besides, i want to add some features to make the library easier to use, such as CLI(command-line interface) or GUI, and then release a new version.

chrisbaldauf commented 6 years ago

How can I reference the version of the module that has the new feature? Currently I have the following configuration in my pom.xml

<dependency>
        <groupId>com.deepoove</groupId>
        <artifactId>swagger-diff</artifactId>
        <version>1.1.0</version>
</dependency>

I tried versions 1.1.1 and 1.2.0, but neither seemed to resolve.

I also didn't see a new version available at https://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.deepoove%22%20AND%20a%3A%22swagger-diff%22

If there's another way that I should be referencing a stable version, please let me know.

Sayi commented 6 years ago

The library must be published to maven repo center, i will do it at this weekend and release a new version like 1.2.0.

Sayi commented 6 years ago

Hi, v1.2.0 has been released.

compile group: 'com.deepoove', name: 'swagger-diff', version: '1.2.0'
chrisbaldauf commented 6 years ago

I've referenced the newly published version successfully, thanks!