File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
src/main/java/com/qdesrame/openapi/diff Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ usage: openapi-diff <old> <new>
7676 --query < property=value> use query param for authorisation
7777 --state Only output diff state: no_changes,
7878 incompatible, compatible
79+ --fail-on-incompatible Fail only if API changes broke backward compatibility
7980 --trace be extra verbose
8081 --version print the version information and exit
8182 --warn Print warning information
Original file line number Diff line number Diff line change @@ -28,6 +28,11 @@ public static void main(String... args) {
2828 .longOpt ("state" )
2929 .desc ("Only output diff state: no_changes, incompatible, compatible" )
3030 .build ());
31+ options .addOption (
32+ Option .builder ()
33+ .longOpt ("fail-on-incompatible" )
34+ .desc ("Fail only if API changes broke backward compatibility" )
35+ .build ());
3136 options .addOption (Option .builder ().longOpt ("trace" ).desc ("be extra verbose" ).build ());
3237 options .addOption (
3338 Option .builder ().longOpt ("debug" ).desc ("Print debugging information" ).build ());
@@ -179,6 +184,8 @@ public static void main(String... args) {
179184 if (line .hasOption ("state" )) {
180185 System .out .println (result .isChanged ().getValue ());
181186 System .exit (0 );
187+ } else if (line .hasOption ("fail-on-incompatible" )) {
188+ System .exit (result .isCompatible () ? 0 : 1 );
182189 } else {
183190 System .exit (result .isUnchanged () ? 0 : 1 );
184191 }
You can’t perform that action at this time.
0 commit comments