sayi / swagger-diff Goto Github PK
View Code? Open in Web Editor NEW:ski: Compare two swagger API specifications(1.x or v2.0)
Home Page: http://deepoove.com/swagger-diff/
License: Apache License 2.0
:ski: Compare two swagger API specifications(1.x or v2.0)
Home Page: http://deepoove.com/swagger-diff/
License: Apache License 2.0
Hi
Could you publish this amazing library as standalone tool to make it much more easier to use? This tool should accept parameters such as OldSpecification, NewSpecification, RenderingMode, OutputFile.
Hi there!
Do you have a plans to support v3 format specs?
Regards,
Serhii
In some cases return type differences are not reported
For example (see attached file) : property "liste" was deleted and property "donneeReference" was added to "rubrique" definition but no difference is being reported by the tool
CDS.zip
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.
Hi. Do you have plans to add Swagger 3.0 support?
com.deepoove.swagger.diff.compare.ModelDiff#diff(io.swagger.models.Model, io.swagger.models.Model, java.lang.String, java.util.Set<io.swagger.models.Model>)
Would it be possible to add some optional parameters to the CLI allow override of CSS path and title when generating HTML?
used mvn package to build the jar. Once build the jar, trying to run the following command
java -jar swagger-diff-1.2.2.jar --help
But getting error -
no main manifest attribute, in swagger-diff-1.2.2.jar
I could say the complexity for implementation of support for V.3 ?
https://swagger.io/specification/
Hello,
What's the license of this library?
Regards
Ofer
There doesn't seem to an option to change the path to http://deepoove.com/swagger-diff/stylesheets/demo.css
In environments with no internet access or where non-https access is blocked, or if that resource becomes unavailable or compromised at some point, the resulting page won't display as expected.
Hi! Great product!
I would like to see diff between models if you don't mind
If model contains $ref like that
"definitions": {
"Pet": {
"type": "object",
"properties": {
"parent_pet": {
"$ref": "#/definitions/Pet"
},
you get infinite recursion for models compare.
Stacktrace:
java.lang.OutOfMemoryError: Java heap space
at com.deepoove.swagger.diff.compare.ModelDiff.diff(ModelDiff.java:65)
Example:
infinite_recursion.txt
I have yaml files and I want generate change logs, Please let me know how to use Yaml file instead of json file ?
Are you using swagger-diff for contract testing? or just to generate the diff report?
Hi. With new v1.2.1 I am getting this error/warning in runtime:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
This is my Java environment:
java 10.0.2 2018-07-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.2+13)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.2+13, mixed mode)
For example, if in petstore_v2_1.json and petstore_v2_2.json you change lines ~723 and ~722 respectively from
"schema": { "$ref": "#/definitions/User" }
to
"schema": { "type" : "array", "items" : { "$ref" : "#/definitions/User" } }
it will no longer detect that there was a change, even though it previously was caught (GET /user/{username}) when it was only a single object being returned. This is pretty important if you only return a certain object type from an endpoint as an array.
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!
Looks like maven is missing the version of jcommander you are using.
Worked around this by excluding the jcommander dependency and depending on the latest version 1.72
The following line of code results in NoSuchMethodError
:-
com.deepoove.swagger.diff.compare.ParameterDiff
private Property mapToProperty(Parameter rightPara) {
Property prop = new StringProperty();
prop.setAccess(rightPara.getAccess());
prop.setAllowEmptyValue(rightPara.getAllowEmptyValue());
prop.setDescription(rightPara.getDescription());
prop.setName(rightPara.getName());
prop.setReadOnly(rightPara.isReadOnly());
prop.setRequired(rightPara.getRequired());
return prop;
}
The offending call is rightPara.getAllowEmptyValue()
where rightPara
is of type io.swagger.models.parameters.Parameter
, imported from io.swagger:swagger-models
. I have trawled the versions of that module and cannot find one that is compatible (i.e. has the method getAllowEmptyValue()
). Help please!!
Other than this, I'm really loving this tool! :)
Hi, nice tool.
The tool never detects response changes. For example return code 401 disappeared in favor of 400 and the difference wasn't reported.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.