File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
src/main/java/com/qdesrame/openapi/diff Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ usage: openapi-diff <old> <new>
76
76
--query < property=value> use query param for authorisation
77
77
--state Only output diff state: no_changes,
78
78
incompatible, compatible
79
+ --fail-on-incompatible Fail only if API changes broke backward compatibility
79
80
--trace be extra verbose
80
81
--version print the version information and exit
81
82
--warn Print warning information
Original file line number Diff line number Diff line change @@ -28,6 +28,16 @@ public static void main(String... args) {
28
28
.longOpt ("state" )
29
29
.desc ("Only output diff state: no_changes, incompatible, compatible" )
30
30
.build ());
31
+ options .addOption (
32
+ Option .builder ()
33
+ .longOpt ("state" )
34
+ .desc ("Only output diff state: no_changes, incompatible, compatible" )
35
+ .build ());
36
+ options .addOption (
37
+ Option .builder ()
38
+ .longOpt ("fail-on-incompatible" )
39
+ .desc ("Fail only if API changes broke backward compatibility" )
40
+ .build ());
31
41
options .addOption (Option .builder ().longOpt ("trace" ).desc ("be extra verbose" ).build ());
32
42
options .addOption (
33
43
Option .builder ().longOpt ("debug" ).desc ("Print debugging information" ).build ());
@@ -179,6 +189,8 @@ public static void main(String... args) {
179
189
if (line .hasOption ("state" )) {
180
190
System .out .println (result .isChanged ().getValue ());
181
191
System .exit (0 );
192
+ } else if (line .hasOption ("fail-on-incompatible" )) {
193
+ System .exit (result .isCompatible () ? 0 : 1 );
182
194
} else {
183
195
System .exit (result .isUnchanged () ? 0 : 1 );
184
196
}
You can’t perform that action at this time.
0 commit comments