File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
cli/src/main/java/org/openapitools/openapidiff/cli Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 33import java .io .File ;
44import java .io .IOException ;
55import java .nio .charset .StandardCharsets ;
6+ import java .util .Arrays ;
7+ import java .util .Collections ;
8+ import java .util .List ;
9+ import java .util .stream .Collectors ;
10+
11+ import io .swagger .v3 .parser .core .models .AuthorizationValue ;
612import org .apache .commons .cli .CommandLine ;
713import org .apache .commons .cli .CommandLineParser ;
814import org .apache .commons .cli .DefaultParser ;
@@ -153,7 +159,14 @@ public static void main(String... args) {
153159 }
154160 String oldPath = line .getArgList ().get (0 );
155161 String newPath = line .getArgList ().get (1 );
156- ChangedOpenApi result = OpenApiCompare .fromLocations (oldPath , newPath );
162+
163+ List <AuthorizationValue > auths = null ;
164+ if (line .hasOption ("header" )) {
165+ String [] headers = line .getOptionValues ("header" );
166+ auths = Collections .singletonList (new AuthorizationValue (headers [0 ], headers [1 ], "header" ));
167+ }
168+
169+ ChangedOpenApi result = OpenApiCompare .fromLocations (oldPath , newPath , auths );
157170 ConsoleRender consoleRender = new ConsoleRender ();
158171 if (!logLevel .equals ("OFF" )) {
159172 System .out .println (consoleRender .render (result ));
You can’t perform that action at this time.
0 commit comments