File tree 1 file changed +14
-1
lines changed
cli/src/main/java/org/openapitools/openapidiff/cli
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change 3
3
import java .io .File ;
4
4
import java .io .IOException ;
5
5
import 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 ;
6
12
import org .apache .commons .cli .CommandLine ;
7
13
import org .apache .commons .cli .CommandLineParser ;
8
14
import org .apache .commons .cli .DefaultParser ;
@@ -153,7 +159,14 @@ public static void main(String... args) {
153
159
}
154
160
String oldPath = line .getArgList ().get (0 );
155
161
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 );
157
170
ConsoleRender consoleRender = new ConsoleRender ();
158
171
if (!logLevel .equals ("OFF" )) {
159
172
System .out .println (consoleRender .render (result ));
You can’t perform that action at this time.
0 commit comments