Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ usage: openapi-diff <old> <new>
--query <property=value> use query param for authorisation
--state Only output diff state: no_changes,
incompatible, compatible
--fail-on-incompatible Fail only if API changes broke backward compatibility
--trace be extra verbose
--version print the version information and exit
--warn Print warning information
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/com/qdesrame/openapi/diff/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ public static void main(String... args) {
.longOpt("state")
.desc("Only output diff state: no_changes, incompatible, compatible")
.build());
options.addOption(
Option.builder()
.longOpt("fail-on-incompatible")
.desc("Fail only if API changes broke backward compatibility")
.build());
options.addOption(Option.builder().longOpt("trace").desc("be extra verbose").build());
options.addOption(
Option.builder().longOpt("debug").desc("Print debugging information").build());
Expand Down Expand Up @@ -179,6 +184,8 @@ public static void main(String... args) {
if (line.hasOption("state")) {
System.out.println(result.isChanged().getValue());
System.exit(0);
} else if (line.hasOption("fail-on-incompatible")) {
System.exit(result.isCompatible() ? 0 : 1);
} else {
System.exit(result.isUnchanged() ? 0 : 1);
}
Expand Down